Memory: vtkClipPolyData initiates ReferenceCount of 3

Charles Law charles.law at kitware.com
Tue Sep 7 08:12:25 EDT 1999


<x-flowed>John,

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.

Charles.

At 04:32 PM 9/5/99 -0500, John Washbourne wrote:
>Hello,
>
>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
>planes).
>
>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
>pipeline.
>
>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
>\n",test->GetReferenceCount());
>
>output:     test->GetReferenceCount(); 3



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------


</x-flowed>



More information about the vtkusers mailing list