[vtkusers] Very important discovery\mistake !

Sebastien Auclair sxa at fluent.com
Tue Jun 3 15:00:24 EDT 2003


Well sorry but i put blocking break points in the destructor of at least 2
filters and they were never deleted !
I changed the order and then they were destroyed.
I just reported what i saw !

And yes our class need to retain the m_polydata and m_normal... That isn't a
leak !

Thanks !
________________________________
Seb

----- Original Message -----
From: "Berk Geveci" <berk.geveci at kitware.com>
To: "VTK users list" <vtkusers at public.kitware.com>
Sent: Tuesday, June 03, 2003 2:39 PM
Subject: Re: [vtkusers] Very important discovery\mistake !


> Just for the record:
>
> > Just for the record !
> >
> > Looks like the order to which "Delete"s are made has some importance !
> > No need to play with "SetReferenceCount()" and stuff.
> > Just deleting in the reverse order the instances were used (created)
> > should destroy all  of them.
>
> This is very wrong. The order in which the objects are deleted is
> not relevant at all. The only possible leak in the example you sent
> are due to the instance variables m_polydata and m_normal. Calling
> SomeClass::CreateHexPolyData () more than once would cause leaks
> because you are not deleting these objects before assigning new values
> to them. Otherwise, there is no leak. Please read the relevant
> sections in the VTK documentation carefully before making assumptions
> about how things work.
>
> > In the past, I've forced sections of pipeline to delete by individually
> > setting the inputs and output of *each* filter to NULL (i.e.
> > disconnecting them all), and removing and other python references to
> > them (no necessary for C++ presumably).
>
> This is not the case in C++. There might be some issues due to Python's
> garbage collection I am not aware of but you should not need to do
> this in Python either.
>
> >
> > As far as I know, a filter is only deleted if it has no connections to
> > any other filters/objects. I'm not sure if VTK is smart enough to detect
> > "isolated" sections of pipline for deletion.
>
> This is not correct either. As long as the references to all objects
> held by the application are released AND there are no circular
> references introduced by the application, there should be no leaks.
>
> -Berk
>
>
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list