[vtkusers] Getting debug errors when deleting objects !!!

Dominik Szczerba domi at vision.ee.ethz.ch
Sat Apr 7 06:33:20 EDT 2007


You dont get an error because the system releases the memory on exit() itself 
and it seems to do better than you, who delete them in a wrong order. The 
easiest solution is to use smart pointers - or to analyze what depends on 
what.
Dominik

On Saturday 07 April 2007 11:33, Syn3DDM wrote:
> Hi
> I am using vtk in a MFC application. My probleme is that when I close the
> main window I got a debug errors ! I wrote the deleting code in the
> destrutor like this :
> CVTKMFCView::~CVTKMFCView()
> {
>                     this->iren->Delete();
>                     this->CameraStyle->Delete();
> 	    this->renWin->Delete();
> 	    this->ren->Delete();
> 	    this->Actor->Delete();
> 	    this->Mapper->Delete();
> 	    this->Polydata->Delete();
> 	    this->PLYReader->Delete();
>            // Delete the the objects used to form the visualisation.
> }
>
> this code causes a debug errors while closing the main window ! but when I
> let the destructor empty like this
>
> CVTKMFCView::~CVTKMFCView()
> {
> }
>
> I got no errors !! No comments !!
> Please help me !
> Thank you in advance.

-- 
Dominik Szczerba, PhD
Computer Vision Lab CH-8092 Zurich
http://www.vision.ee.ethz.ch/~domi



More information about the vtkusers mailing list