[vtkusers] Unhandled exception at the time of Unregistering vtkSmartPointer

Jochen K. jochen.kling at email.de
Mon Jun 11 23:53:31 EDT 2012


Hi Ahmad,

no, this causes no memory leak. 

In David's example the following statement frees up singlePolyData's memory.

  vectorOfPolyData[0]->Delete();

vectorOfPolyData[0] is nothing else but a pointer to the polyData object,
and do not contain any data except the address of the polyData object.

So when this line gets called, not vectorOfPolyData[0] get's deleted but the
object where vectorOfPolyData[0] is pointing to.

So when you add singlePolyData->Delete() at the end of David's example you
try to delete the object twice. That's why you get an exception. 


Hopefully my explanation is understandable.

with best regards
Jochen


--
View this message in context: http://vtk.1045678.n5.nabble.com/Unhandled-exception-at-the-time-of-Unregistering-vtkSmartPointer-tp5713691p5713772.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list