[vtkusers] Cone6.cxx vtkBoxWidget memory leak

Drew Dolgert ajd27 at cornell.edu
Sun May 9 12:44:48 EDT 2004


Hi,

The leak is in the callback:

  virtual void Execute(vtkObject *caller, unsigned long, void*)
    {
      vtkTransform *t = vtkTransform::New();
      vtkBoxWidget *widget = reinterpret_cast<vtkBoxWidget*>(caller);
      widget->GetTransform(t);
      widget->GetProp3D()->SetUserTransform(t);
      // Add this:
      t->Delete();
    }

You need to release the reference to the transform at the end.

- Drew

-----Original Message-----
From: vtkusers-admin at vtk.org [mailto:vtkusers-admin at vtk.org] On Behalf
Of Luca Picello
Sent: Sunday, May 09, 2004 12:36 PM
To: VTK Users
Subject: [vtkusers] Cone6.cxx vtkBoxWidget memory leak


Hallo everybody,
I compiled VTK with Borland C++ builder 6 with Codeguard memory leak 
manager.
Then I compiled Cone6.cxx (no VCL, without using vtkBorlandRenderWindow 
component ).
It starts and runs successfully and it exists fine if I dont throw any 
mouse event on the cone area.
But start the application and just move a little ball around the cone 
and exit: codeguard returns error.
Take a look to the screenshot.

Can somebody (author?) help me to solve?
Picello Luca





More information about the vtkusers mailing list