[vtkusers] Delete() usage

Sebastien Jourdain sebastien.jourdain at kitware.com
Wed Oct 10 11:39:08 EDT 2012


Are you in C++ or in Java. Looking at the code, it looks like Java.

If you are in Java, you are almost fine, you just need to call or
setup the specific VTK Garbage collector. No need to call Delete()
manually.

For more details, you can look at the Java sample code, which
illustrate how to initialize it to make it run in the background,
otherwise you can manually call it from your code.

By default, it is not started and therefore, the memory is never released.

Seb

On Wed, Oct 10, 2012 at 10:55 AM, Jean-Hugues Royer <jhroyer at joher.com> wrote:
> Hi,
>
> Tracking memory leaks...
>
> As far as I read we are supposed to call the Delete() method each time we
> issue a New() object.
>
>
> Are we also supposed to call Delete() on objects we received from Get*()
> functions ?
>
> Example:
>
> vtkPolyData pd =
> vtkContourWidget.GetContourRepresentation().GetContourRepresentationAsPolyData()
>
> Do I have to call pd.Delete() to free it or will vtkContourWidget free it
> when deleted ?
>
>
> And regarding Set*() functions, example:
>
> vtkPlaneCollection pc = vtkPlaneCollection.New();
> vtkSmartVolumeMapper.SetClippingPlanes(pc);
>
> Do I have to call pd.Delete() to free the plane collection or will it be
> freed when the vtkSmartVolumeMapper will be deleted ?
>
>
> Thanks.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list