Memory: vtkClipPolyData initiates ReferenceCount of 3

Charles Law at
Tue Sep 7 08:12:25 EDT 1999


When you create the filter, a poly data output is created as well.  This
poly data references the filter (which explains 2 of your 3 reference
counts.  This creates a circular reference, which is handle properly
when you delete the object.  I am not sure where the third reference is
coming from, but it probably not an error.  All the regression examples
are tested for memory leaks each night using Purify.


At 04:32 PM 9/5/99 -0500, John Washbourne wrote:
>I have a vtk pipeline going for some timelapse data. I am trying to make
>a movie by dumping frames of linear combinations of four datasets
>(approx 200 frames per pair of datasets: 600 total).  I had to
>concentrate on immediately freeing memory via Delete() or else leak 10
>Mb per frame (via ContourFilter, various slice planes, and clipping
>Now each time I add a reference to an object (after it is initialized
>with New()) I then immediately use Delete on the original data. I have
>been using the vtkObject->GetReferenceCount to verify this and do in
>fact end up with a ref. count of 1 for all of the objects in the
>Except for vtkClipPolyData, which initializes to a reference count of 3.
>Witness the output from this code snippet:
>     vtkClipPolyData *test = vtkClipPolyData::New();
>     printf ("test->GetReferenceCount(); %d
>output:     test->GetReferenceCount(); 3

This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.


More information about the vtkusers mailing list