You must delete the interactor before exit.<br><br>In C++ I always use vtkSmartPointer&#39;s and do not use Delete()&#39;s.<br><br><div class="gmail_quote">On Sun, Sep 23, 2012 at 1:13 PM, P.J.Schaafsma <span dir="ltr">&lt;<a href="mailto:jetze.schaafsma@gmail.com" target="_blank">jetze.schaafsma@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Here&#39;s some even simpler C++ code that has the same problem. I shouldn&#39;t have<br>
to explicitly Unregister the actors to make them reach reference count 0.<br>
That wouldn&#39;t make sense.<br>
<br>
The extra render window creation at the bottom is used to track how much<br>
memory is &#39;lost&#39; eventually. With the key line with the Render() call<br>
commented out, memory use is 14Mb during both the first and second event<br>
loops triggered by interactor-&gt;Start(). With the key line enabled. Memory<br>
use is 115Mb during the first, and 54Mb during the second event loop.<br>
<br>
valgrind shows only a few hundred kbytes unfreed at program exit. The many<br>
invalid reads are expected, and they show that the objects are actually<br>
being deleted. Interspersed with the valgrind output is also the result of<br>
the print statements, showing undefined values for object reference counts.<br>
<br>
<br>
C++ Code<br>
<br>
int main()<br>
{<br>
        vtkXMLImageDataReader *reader = vtkXMLImageDataReader::New();<br>
        //reader-&gt;SetFileName(&quot;e:\\data\\volume\\manix_low.vti&quot;);<br>
        reader-&gt;SetFileName(&quot;/media/Data/data/volume/manix_low.vti&quot;);<br>
<br>
        vtkContourFilter *contour = vtkContourFilter::New();<br>
        contour-&gt;SetInputConnection(reader-&gt;GetOutputPort());<br>
        contour-&gt;SetValue(0, 800);<br>
<br>
        vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();<br>
        mapper-&gt;SetInputConnection(contour-&gt;GetOutputPort());<br>
        mapper-&gt;Update();<br>
<br>
        vtkActor *actor = vtkActor::New();<br>
        actor-&gt;SetMapper(mapper);<br>
<br>
        vtkRenderer *renderer = vtkRenderer::New();<br>
        renderer-&gt;AddActor(actor);<br>
<br>
        vtkRenderWindow *render_window = vtkRenderWindow::New();<br>
        render_window-&gt;AddRenderer(renderer);<br>
<br>
        vtkInteractorStyleTrackballCamera *style =<br>
vtkInteractorStyleTrackballCamera::New();<br>
<br>
        vtkRenderWindowInteractor *interactor = vtkRenderWindowInteractor::New();<br>
        interactor-&gt;SetInteractorStyle(style);<br>
        interactor-&gt;SetRenderWindow(render_window);<br>
        interactor-&gt;Initialize();<br>
<br>
        printf(&quot;contour: %d\n&quot;, contour-&gt;GetReferenceCount());<br>
        printf(&quot;mapper: %d\n&quot;, mapper-&gt;GetReferenceCount());<br>
        printf(&quot;actor: %d\n&quot;, actor-&gt;GetReferenceCount());<br>
        printf(&quot;renderer: %d\n&quot;, renderer-&gt;GetReferenceCount());<br>
        printf(&quot;render_window: %d\n&quot;, render_window-&gt;GetReferenceCount());<br>
        printf(&quot;interactor: %d\n&quot;, interactor-&gt;GetReferenceCount());<br>
        printf(&quot;style: %d\n&quot;, style-&gt;GetReferenceCount());<br>
        printf(&quot;\n&quot;);<br>
<br>
        ////// Comment this out and save memory<br>
        render_window-&gt;Render();<br>
        //////<br>
<br>
        printf(&quot;contour: %d\n&quot;, contour-&gt;GetReferenceCount());<br>
        printf(&quot;mapper: %d\n&quot;, mapper-&gt;GetReferenceCount());<br>
        printf(&quot;actor: %d\n&quot;, actor-&gt;GetReferenceCount());<br>
        printf(&quot;renderer: %d\n&quot;, renderer-&gt;GetReferenceCount());<br>
        printf(&quot;render_window: %d\n&quot;, render_window-&gt;GetReferenceCount());<br>
        printf(&quot;interactor: %d\n&quot;, interactor-&gt;GetReferenceCount());<br>
        printf(&quot;style: %d\n&quot;, style-&gt;GetReferenceCount());<br>
        printf(&quot;\n&quot;);<br>
<br>
        renderer-&gt;RemoveActor(actor);<br>
        render_window-&gt;Render();<br>
<br>
        printf(&quot;contour: %d\n&quot;, contour-&gt;GetReferenceCount());<br>
        printf(&quot;mapper: %d\n&quot;, mapper-&gt;GetReferenceCount());<br>
        printf(&quot;actor: %d\n&quot;, actor-&gt;GetReferenceCount());<br>
        printf(&quot;renderer: %d\n&quot;, renderer-&gt;GetReferenceCount());<br>
        printf(&quot;render_window: %d\n&quot;, render_window-&gt;GetReferenceCount());<br>
        printf(&quot;interactor: %d\n&quot;, interactor-&gt;GetReferenceCount());<br>
        printf(&quot;style: %d\n&quot;, style-&gt;GetReferenceCount());<br>
        printf(&quot;\n&quot;);<br>
<br>
<br>
        actor-&gt;Delete();<br>
        mapper-&gt;Delete();<br>
        contour-&gt;Delete();<br>
        reader-&gt;Delete();<br>
<br>
        printf(&quot;contour: %d\n&quot;, contour-&gt;GetReferenceCount());<br>
        printf(&quot;mapper: %d\n&quot;, mapper-&gt;GetReferenceCount());<br>
        printf(&quot;actor: %d\n&quot;, actor-&gt;GetReferenceCount());<br>
        printf(&quot;renderer: %d\n&quot;, renderer-&gt;GetReferenceCount());<br>
        printf(&quot;render_window: %d\n&quot;, render_window-&gt;GetReferenceCount());<br>
        printf(&quot;interactor: %d\n&quot;, interactor-&gt;GetReferenceCount());<br>
        printf(&quot;style: %d\n&quot;, style-&gt;GetReferenceCount());<br>
        printf(&quot;\n&quot;);<br>
<br>
<br>
        interactor-&gt;Start();<br>
<br>
        render_window-&gt;RemoveRenderer(renderer);<br>
        interactor-&gt;SetInteractorStyle(0);<br>
<br>
        style-&gt;Delete();<br>
        interactor-&gt;Delete();<br>
        renderer-&gt;Delete();<br>
        render_window-&gt;Delete();<br>
<br>
        printf(&quot;contour: %d\n&quot;, contour-&gt;GetReferenceCount());<br>
        printf(&quot;mapper: %d\n&quot;, mapper-&gt;GetReferenceCount());<br>
        printf(&quot;actor: %d\n&quot;, actor-&gt;GetReferenceCount());<br>
        printf(&quot;renderer: %d\n&quot;, renderer-&gt;GetReferenceCount());<br>
        printf(&quot;render_window: %d\n&quot;, render_window-&gt;GetReferenceCount());<br>
        printf(&quot;interactor: %d\n&quot;, interactor-&gt;GetReferenceCount());<br>
        printf(&quot;style: %d\n&quot;, style-&gt;GetReferenceCount());<br>
        printf(&quot;\n&quot;);<br>
<br>
        render_window = vtkRenderWindow::New();<br>
        interactor = vtkRenderWindowInteractor::New();<br>
        interactor-&gt;SetRenderWindow(render_window);<br>
        interactor-&gt;Initialize();<br>
        interactor-&gt;Start();<br>
<br>
<br>
        printf(&quot;Done\n&quot;);<br>
<br>
        return 0;<br>
<br>
Valgrind output<br>
<br>
==9499== Memcheck, a memory error detector<br>
==9499== Copyright (C) 2002-2011, and GNU GPL&#39;d, by Julian Seward et al.<br>
==9499== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info<br>
==9499== Command: ../../../../bin/Cone5<br>
==9499==<br>
contour: 2<br>
mapper: 3<br>
actor: 2<br>
renderer: 2<br>
render_window: 2<br>
interactor: 2<br>
style: 2<br>
<br>
==9499== Conditional jump or move depends on uninitialised value(s)<br>
==9499==    at 0xD47E900: ??? (in<br>
/usr/lib/nvidia-current/libnvidia-glcore.so.295.40)<br>
==9499==    by 0x7FEFFFEDF: ???<br>
==9499==    by 0x7FEFFF0DF: ???<br>
==9499==    by 0xE272F1F: ???<br>
==9499==    by 0x7FEFFF01F: ???<br>
==9499==    by 0x7FEFFF137: ???<br>
==9499==    by 0x40B4DE7: ???<br>
==9499==    by 0x4070FFF: ??? (in /dev/nvidia0)<br>
==9499==    by 0x17F5E03F: ???<br>
==9499==    by 0x1360E32F: ???<br>
==9499==    by 0xFC4F67F: ???<br>
==9499==    by 0x1FFFFFFFF: ???<br>
==9499==<br>
==9499== Conditional jump or move depends on uninitialised value(s)<br>
==9499==    at 0xD47E909: ??? (in<br>
/usr/lib/nvidia-current/libnvidia-glcore.so.295.40)<br>
==9499==    by 0x7FEFFFEDF: ???<br>
==9499==    by 0x7FEFFF0DF: ???<br>
==9499==    by 0xE272F1F: ???<br>
==9499==    by 0x7FEFFF01F: ???<br>
==9499==    by 0x7FEFFF137: ???<br>
==9499==    by 0x40B4DE7: ???<br>
==9499==    by 0x4070FFF: ??? (in /dev/nvidia0)<br>
==9499==    by 0x17F5E03F: ???<br>
==9499==    by 0x1360E32F: ???<br>
==9499==    by 0xFC4F67F: ???<br>
==9499==    by 0x1FFFFFFFF: ???<br>
==9499==<br>
==9499== Use of uninitialised value of size 8<br>
==9499==    at 0xD47E916: ??? (in<br>
/usr/lib/nvidia-current/libnvidia-glcore.so.295.40)<br>
==9499==    by 0x7FEFFFEDF: ???<br>
==9499==    by 0x7FEFFF0DF: ???<br>
==9499==    by 0xE272F1F: ???<br>
==9499==    by 0x7FEFFF01F: ???<br>
==9499==    by 0x7FEFFF137: ???<br>
==9499==    by 0x40B4DE7: ???<br>
==9499==    by 0x4070FFF: ??? (in /dev/nvidia0)<br>
==9499==    by 0x17F5E03F: ???<br>
==9499==    by 0x1360E32F: ???<br>
==9499==    by 0xFC4F67F: ???<br>
==9499==    by 0x1FFFFFFFF: ???<br>
==9499==<br>
contour: 2<br>
mapper: 3<br>
actor: 2<br>
renderer: 2<br>
render_window: 2<br>
interactor: 2<br>
style: 2<br>
<br>
contour: 2<br>
mapper: 3<br>
actor: 1<br>
renderer: 2<br>
render_window: 2<br>
interactor: 2<br>
style: 2<br>
<br>
==9499== Invalid read of size 4<br>
==9499==    at 0x401798: vtkObjectBase::GetReferenceCount()<br>
(vtkObjectBase.h:143)<br>
==9499==    by 0x401485: main (Cone5.cxx:109)<br>
==9499==  Address 0xfbfec58 is 8 bytes inside a block of size 200 free&#39;d<br>
==9499==    at 0x4C2A4BC: operator delete(void*) (in<br>
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==9499==    by 0x637B1DF: vtkContourFilter::~vtkContourFilter()<br>
(vtkContourFilter.cxx:95)<br>
==9499==    by 0x781C8F0: vtkObjectBase::UnRegisterInternal(vtkObjectBase*,<br>
int) (vtkObjectBase.cxx:286)<br>
==9499==    by 0x781AE56: vtkObject::UnRegisterInternal(vtkObjectBase*, int)<br>
(vtkObject.cxx:885)<br>
==9499==    by 0x77A11F8:<br>
vtkGarbageCollectorToObjectBaseFriendship::UnRegister(vtkObjectBase*,<br>
vtkObjectBase*) (vtkGarbageCollector.cxx:141)<br>
==9499==    by 0x779FB69:<br>
vtkGarbageCollectorImpl::CollectComponent(vtkGarbageCollectorImpl::ComponentType*)<br>
(vtkGarbageCollector.cxx:702)<br>
==9499==    by 0x779EDE0:<br>
vtkGarbageCollectorImpl::CollectInternal(vtkObjectBase*)<br>
(vtkGarbageCollector.cxx:473)<br>
==9499==    by 0x77A0A14: vtkGarbageCollector::Collect(vtkObjectBase*)<br>
(vtkGarbageCollector.cxx:904)<br>
==9499==    by 0x781C904: vtkObjectBase::UnRegisterInternal(vtkObjectBase*,<br>
int) (vtkObjectBase.cxx:294)<br>
==9499==    by 0x781AE56: vtkObject::UnRegisterInternal(vtkObjectBase*, int)<br>
(vtkObject.cxx:885)<br>
==9499==    by 0x6F8B8F3: vtkAlgorithm::UnRegister(vtkObjectBase*)<br>
(vtkAlgorithm.cxx:917)<br>
==9499==    by 0x781C29B: vtkObjectBase::Delete() (vtkObjectBase.cxx:134)<br>
==9499==<br>
contour: 0<br>
==9499== Invalid read of size 4<br>
==9499==    at 0x401798: vtkObjectBase::GetReferenceCount()<br>
(vtkObjectBase.h:143)<br>
==9499==    by 0x4014A2: main (Cone5.cxx:110)<br>
==9499==  Address 0xfc15e18 is 8 bytes inside a block of size 664 free&#39;d<br>
==9499==    at 0x4C2A4BC: operator delete(void*) (in<br>
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==9499==    by 0x5153D63:<br>
vtkPainterPolyDataMapper::~vtkPainterPolyDataMapper()<br>
(vtkPainterPolyDataMapper.cxx:96)<br>
==9499==    by 0x781C8F0: vtkObjectBase::UnRegisterInternal(vtkObjectBase*,<br>
int) (vtkObjectBase.cxx:286)<br>
==9499==    by 0x781AE56: vtkObject::UnRegisterInternal(vtkObjectBase*, int)<br>
(vtkObject.cxx:885)<br>
==9499==    by 0x77A11F8:<br>
vtkGarbageCollectorToObjectBaseFriendship::UnRegister(vtkObjectBase*,<br>
vtkObjectBase*) (vtkGarbageCollector.cxx:141)<br>
==9499==    by 0x779FB69:<br>
vtkGarbageCollectorImpl::CollectComponent(vtkGarbageCollectorImpl::ComponentType*)<br>
(vtkGarbageCollector.cxx:702)<br>
==9499==    by 0x779EDE0:<br>
vtkGarbageCollectorImpl::CollectInternal(vtkObjectBase*)<br>
(vtkGarbageCollector.cxx:473)<br>
==9499==    by 0x77A0A14: vtkGarbageCollector::Collect(vtkObjectBase*)<br>
(vtkGarbageCollector.cxx:904)<br>
==9499==    by 0x781C904: vtkObjectBase::UnRegisterInternal(vtkObjectBase*,<br>
int) (vtkObjectBase.cxx:294)<br>
==9499==    by 0x781AE56: vtkObject::UnRegisterInternal(vtkObjectBase*, int)<br>
(vtkObject.cxx:885)<br>
==9499==    by 0x6F8B8F3: vtkAlgorithm::UnRegister(vtkObjectBase*)<br>
(vtkAlgorithm.cxx:917)<br>
==9499==    by 0x781C29B: vtkObjectBase::Delete() (vtkObjectBase.cxx:134)<br>
==9499==<br>
mapper: 0<br>
==9499== Invalid read of size 4<br>
==9499==    at 0x401798: vtkObjectBase::GetReferenceCount()<br>
(vtkObjectBase.h:143)<br>
==9499==    by 0x4014BF: main (Cone5.cxx:111)<br>
==9499==  Address 0x127d71d8 is 8 bytes inside a block of size 440 free&#39;d<br>
==9499==    at 0x4C2A4BC: operator delete(void*) (in<br>
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==9499==    by 0x5265837: vtkOpenGLActor::~vtkOpenGLActor()<br>
(vtkOpenGLActor.h:42)<br>
==9499==    by 0x781C8F0: vtkObjectBase::UnRegisterInternal(vtkObjectBase*,<br>
int) (vtkObjectBase.cxx:286)<br>
==9499==    by 0x781AE56: vtkObject::UnRegisterInternal(vtkObjectBase*, int)<br>
(vtkObject.cxx:885)<br>
==9499==    by 0x781C515: vtkObjectBase::UnRegister(vtkObjectBase*)<br>
(vtkObjectBase.cxx:189)<br>
==9499==    by 0x781C29B: vtkObjectBase::Delete() (vtkObjectBase.cxx:134)<br>
==9499==    by 0x401434: main (Cone5.cxx:104)<br>
==9499==<br>
actor: 0<br>
renderer: 2<br>
render_window: 2<br>
interactor: 2<br>
style: 2<br>
<br>
==9499== Invalid read of size 4<br>
==9499==    at 0x401798: vtkObjectBase::GetReferenceCount()<br>
(vtkObjectBase.h:143)<br>
==9499==    by 0x401600: main (Cone5.cxx:129)<br>
==9499==  Address 0xfbfec58 is 8 bytes inside a block of size 200 free&#39;d<br>
==9499==    at 0x4C2A4BC: operator delete(void*) (in<br>
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==9499==    by 0x637B1DF: vtkContourFilter::~vtkContourFilter()<br>
(vtkContourFilter.cxx:95)<br>
==9499==    by 0x781C8F0: vtkObjectBase::UnRegisterInternal(vtkObjectBase*,<br>
int) (vtkObjectBase.cxx:286)<br>
==9499==    by 0x781AE56: vtkObject::UnRegisterInternal(vtkObjectBase*, int)<br>
(vtkObject.cxx:885)<br>
==9499==    by 0x77A11F8:<br>
vtkGarbageCollectorToObjectBaseFriendship::UnRegister(vtkObjectBase*,<br>
vtkObjectBase*) (vtkGarbageCollector.cxx:141)<br>
==9499==    by 0x779FB69:<br>
vtkGarbageCollectorImpl::CollectComponent(vtkGarbageCollectorImpl::ComponentType*)<br>
(vtkGarbageCollector.cxx:702)<br>
==9499==    by 0x779EDE0:<br>
vtkGarbageCollectorImpl::CollectInternal(vtkObjectBase*)<br>
(vtkGarbageCollector.cxx:473)<br>
==9499==    by 0x77A0A14: vtkGarbageCollector::Collect(vtkObjectBase*)<br>
(vtkGarbageCollector.cxx:904)<br>
==9499==    by 0x781C904: vtkObjectBase::UnRegisterInternal(vtkObjectBase*,<br>
int) (vtkObjectBase.cxx:294)<br>
==9499==    by 0x781AE56: vtkObject::UnRegisterInternal(vtkObjectBase*, int)<br>
(vtkObject.cxx:885)<br>
==9499==    by 0x6F8B8F3: vtkAlgorithm::UnRegister(vtkObjectBase*)<br>
(vtkAlgorithm.cxx:917)<br>
==9499==    by 0x781C29B: vtkObjectBase::Delete() (vtkObjectBase.cxx:134)<br>
==9499==<br>
contour: 0<br>
==9499== Invalid read of size 4<br>
==9499==    at 0x401798: vtkObjectBase::GetReferenceCount()<br>
(vtkObjectBase.h:143)<br>
==9499==    by 0x40161D: main (Cone5.cxx:130)<br>
==9499==  Address 0xfc15e18 is 8 bytes inside a block of size 664 free&#39;d<br>
==9499==    at 0x4C2A4BC: operator delete(void*) (in<br>
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==9499==    by 0x5153D63:<br>
vtkPainterPolyDataMapper::~vtkPainterPolyDataMapper()<br>
(vtkPainterPolyDataMapper.cxx:96)<br>
==9499==    by 0x781C8F0: vtkObjectBase::UnRegisterInternal(vtkObjectBase*,<br>
int) (vtkObjectBase.cxx:286)<br>
==9499==    by 0x781AE56: vtkObject::UnRegisterInternal(vtkObjectBase*, int)<br>
(vtkObject.cxx:885)<br>
==9499==    by 0x77A11F8:<br>
vtkGarbageCollectorToObjectBaseFriendship::UnRegister(vtkObjectBase*,<br>
vtkObjectBase*) (vtkGarbageCollector.cxx:141)<br>
==9499==    by 0x779FB69:<br>
vtkGarbageCollectorImpl::CollectComponent(vtkGarbageCollectorImpl::ComponentType*)<br>
(vtkGarbageCollector.cxx:702)<br>
==9499==    by 0x779EDE0:<br>
vtkGarbageCollectorImpl::CollectInternal(vtkObjectBase*)<br>
(vtkGarbageCollector.cxx:473)<br>
==9499==    by 0x77A0A14: vtkGarbageCollector::Collect(vtkObjectBase*)<br>
(vtkGarbageCollector.cxx:904)<br>
==9499==    by 0x781C904: vtkObjectBase::UnRegisterInternal(vtkObjectBase*,<br>
int) (vtkObjectBase.cxx:294)<br>
==9499==    by 0x781AE56: vtkObject::UnRegisterInternal(vtkObjectBase*, int)<br>
(vtkObject.cxx:885)<br>
==9499==    by 0x6F8B8F3: vtkAlgorithm::UnRegister(vtkObjectBase*)<br>
(vtkAlgorithm.cxx:917)<br>
==9499==    by 0x781C29B: vtkObjectBase::Delete() (vtkObjectBase.cxx:134)<br>
==9499==<br>
mapper: 0<br>
==9499== Invalid read of size 4<br>
==9499==    at 0x401798: vtkObjectBase::GetReferenceCount()<br>
(vtkObjectBase.h:143)<br>
==9499==    by 0x40163A: main (Cone5.cxx:131)<br>
==9499==  Address 0x127d71d8 is 8 bytes inside a block of size 440 free&#39;d<br>
==9499==    at 0x4C2A4BC: operator delete(void*) (in<br>
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==9499==    by 0x5265837: vtkOpenGLActor::~vtkOpenGLActor()<br>
(vtkOpenGLActor.h:42)<br>
==9499==    by 0x781C8F0: vtkObjectBase::UnRegisterInternal(vtkObjectBase*,<br>
int) (vtkObjectBase.cxx:286)<br>
==9499==    by 0x781AE56: vtkObject::UnRegisterInternal(vtkObjectBase*, int)<br>
(vtkObject.cxx:885)<br>
==9499==    by 0x781C515: vtkObjectBase::UnRegister(vtkObjectBase*)<br>
(vtkObjectBase.cxx:189)<br>
==9499==    by 0x781C29B: vtkObjectBase::Delete() (vtkObjectBase.cxx:134)<br>
==9499==    by 0x401434: main (Cone5.cxx:104)<br>
==9499==<br>
actor: 0<br>
==9499== Invalid read of size 4<br>
==9499==    at 0x401798: vtkObjectBase::GetReferenceCount()<br>
(vtkObjectBase.h:143)<br>
==9499==    by 0x401657: main (Cone5.cxx:132)<br>
==9499==  Address 0x1284a2f8 is 8 bytes inside a block of size 808 free&#39;d<br>
==9499==    at 0x4C2A4BC: operator delete(void*) (in<br>
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==9499==    by 0x52A411D: vtkOpenGLRenderer::~vtkOpenGLRenderer()<br>
(vtkOpenGLRenderer.cxx:1278)<br>
==9499==    by 0x781C8F0: vtkObjectBase::UnRegisterInternal(vtkObjectBase*,<br>
int) (vtkObjectBase.cxx:286)<br>
==9499==    by 0x781AE56: vtkObject::UnRegisterInternal(vtkObjectBase*, int)<br>
(vtkObject.cxx:885)<br>
==9499==    by 0x781C515: vtkObjectBase::UnRegister(vtkObjectBase*)<br>
(vtkObjectBase.cxx:189)<br>
==9499==    by 0x781C29B: vtkObjectBase::Delete() (vtkObjectBase.cxx:134)<br>
==9499==    by 0x4015DD: main (Cone5.cxx:126)<br>
==9499==<br>
renderer: 0<br>
==9499== Invalid read of size 4<br>
==9499==    at 0x401798: vtkObjectBase::GetReferenceCount()<br>
(vtkObjectBase.h:143)<br>
==9499==    by 0x401674: main (Cone5.cxx:133)<br>
==9499==  Address 0x1284a8b8 is 8 bytes inside a block of size 632 free&#39;d<br>
==9499==    at 0x4C2A4BC: operator delete(void*) (in<br>
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==9499==    by 0x52F5C59: vtkXOpenGLRenderWindow::~vtkXOpenGLRenderWindow()<br>
(vtkXOpenGLRenderWindow.cxx:455)<br>
==9499==    by 0x781C8F0: vtkObjectBase::UnRegisterInternal(vtkObjectBase*,<br>
int) (vtkObjectBase.cxx:286)<br>
==9499==    by 0x781AE56: vtkObject::UnRegisterInternal(vtkObjectBase*, int)<br>
(vtkObject.cxx:885)<br>
==9499==    by 0x781C515: vtkObjectBase::UnRegister(vtkObjectBase*)<br>
(vtkObjectBase.cxx:189)<br>
==9499==    by 0x51B6D56: vtkRenderWindow::UnRegister(vtkObjectBase*)<br>
(vtkRenderWindow.cxx:1309)<br>
==9499==    by 0x51BF26A:<br>
vtkRenderWindowInteractor::SetRenderWindow(vtkRenderWindow*)<br>
(vtkRenderWindowInteractor.cxx:194)<br>
==9499==    by 0x51B6D25: vtkRenderWindow::UnRegister(vtkObjectBase*)<br>
(vtkRenderWindow.cxx:1303)<br>
==9499==    by 0x781C29B: vtkObjectBase::Delete() (vtkObjectBase.cxx:134)<br>
==9499==    by 0x4015F4: main (Cone5.cxx:127)<br>
==9499==<br>
render_window: 0<br>
==9499== Invalid read of size 4<br>
==9499==    at 0x401798: vtkObjectBase::GetReferenceCount()<br>
(vtkObjectBase.h:143)<br>
==9499==    by 0x401691: main (Cone5.cxx:134)<br>
==9499==  Address 0x127e70e8 is 8 bytes inside a block of size 312 free&#39;d<br>
==9499==    at 0x4C2A4BC: operator delete(void*) (in<br>
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==9499==    by 0x525253F:<br>
vtkXRenderWindowInteractor::~vtkXRenderWindowInteractor()<br>
(vtkXRenderWindowInteractor.cxx:147)<br>
==9499==    by 0x781C8F0: vtkObjectBase::UnRegisterInternal(vtkObjectBase*,<br>
int) (vtkObjectBase.cxx:286)<br>
==9499==    by 0x781AE56: vtkObject::UnRegisterInternal(vtkObjectBase*, int)<br>
(vtkObject.cxx:885)<br>
==9499==    by 0x781C515: vtkObjectBase::UnRegister(vtkObjectBase*)<br>
(vtkObjectBase.cxx:189)<br>
==9499==    by 0x51BF203:<br>
vtkRenderWindowInteractor::UnRegister(vtkObjectBase*)<br>
(vtkRenderWindowInteractor.cxx:181)<br>
==9499==    by 0x51B6D41: vtkRenderWindow::UnRegister(vtkObjectBase*)<br>
(vtkRenderWindow.cxx:1304)<br>
==9499==    by 0x781C29B: vtkObjectBase::Delete() (vtkObjectBase.cxx:134)<br>
==9499==    by 0x4015F4: main (Cone5.cxx:127)<br>
==9499==<br>
interactor: 0<br>
==9499== Invalid read of size 4<br>
==9499==    at 0x401798: vtkObjectBase::GetReferenceCount()<br>
(vtkObjectBase.h:143)<br>
==9499==    by 0x4016AE: main (Cone5.cxx:135)<br>
==9499==  Address 0x1284ad18 is 8 bytes inside a block of size 280 free&#39;d<br>
==9499==    at 0x4C2A4BC: operator delete(void*) (in<br>
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)<br>
==9499==    by 0x50CBE9F:<br>
vtkInteractorStyleTrackballCamera::~vtkInteractorStyleTrackballCamera()<br>
(vtkInteractorStyleTrackballCamera.cxx:36)<br>
==9499==    by 0x781C8F0: vtkObjectBase::UnRegisterInternal(vtkObjectBase*,<br>
int) (vtkObjectBase.cxx:286)<br>
==9499==    by 0x781AE56: vtkObject::UnRegisterInternal(vtkObjectBase*, int)<br>
(vtkObject.cxx:885)<br>
==9499==    by 0x781C515: vtkObjectBase::UnRegister(vtkObjectBase*)<br>
(vtkObjectBase.cxx:189)<br>
==9499==    by 0x781C29B: vtkObjectBase::Delete() (vtkObjectBase.cxx:134)<br>
==9499==    by 0x4015AF: main (Cone5.cxx:124)<br>
==9499==<br>
style: 0<br>
<br>
Done<br>
==9499==<br>
==9499== FILE DESCRIPTORS: 5 open at exit.<br>
==9499== Open AF_UNIX socket 3: &lt;unknown&gt;<br>
==9499==    at 0x805D757: socket (syscall-template.S:82)<br>
==9499==    by 0xEAB80BA: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)<br>
==9499==    by 0xEAB8543: xcb_connect_to_display_with_auth_info (in<br>
/usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)<br>
==9499==    by 0x9427EF1: _XConnectXCB (in<br>
/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)<br>
==9499==    by 0x9418A40: XOpenDisplay (in<br>
/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)<br>
==9499==    by 0x91A354E: XtOpenDisplay (in<br>
/usr/lib/x86_64-linux-gnu/libXt.so.6.0.0)<br>
==9499==    by 0x5252EA3: vtkXRenderWindowInteractor::Initialize()<br>
(vtkXRenderWindowInteractor.cxx:366)<br>
==9499==    by 0x401707: main (Cone5.cxx:141)<br>
==9499==<br>
==9499== Open file descriptor 9: /proc/2720/auxv<br>
==9499==    &lt;inherited from parent&gt;<br>
==9499==<br>
==9499== Open file descriptor 2: /dev/pts/1<br>
==9499==    &lt;inherited from parent&gt;<br>
==9499==<br>
==9499== Open file descriptor 1: /dev/pts/1<br>
==9499==    &lt;inherited from parent&gt;<br>
==9499==<br>
==9499== Open file descriptor 0: /dev/pts/1<br>
==9499==    &lt;inherited from parent&gt;<br>
==9499==<br>
==9499==<br>
==9499== HEAP SUMMARY:<br>
==9499==     in use at exit: 508,751 bytes in 2,432 blocks<br>
==9499==   total heap usage: 32,927 allocs, 30,495 frees, 915,497,381 bytes<br>
allocated<br>
==9499==<br>
==9499== LEAK SUMMARY:<br>
==9499==    definitely lost: 262,268 bytes in 3 blocks<br>
==9499==    indirectly lost: 176 bytes in 4 blocks<br>
==9499==      possibly lost: 180 bytes in 5 blocks<br>
==9499==    still reachable: 246,127 bytes in 2,420 blocks<br>
==9499==         suppressed: 0 bytes in 0 blocks<br>
==9499== Rerun with --leak-check=full to see details of leaked memory<br>
==9499==<br>
==9499== For counts of detected and suppressed errors, rerun with: -v<br>
==9499== Use --track-origins=yes to see where uninitialised values come from<br>
==9499== ERROR SUMMARY: 6153 errors from 13 contexts (suppressed: 2 from 2)<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/VTK-not-releasing-memory-including-minimal-example-tp5716258p5716261.html" target="_blank">http://vtk.1045678.n5.nabble.com/VTK-not-releasing-memory-including-minimal-example-tp5716258p5716261.html</a><br>

<div class="im HOEnZb">Sent from the VTK - Users mailing list archive at Nabble.com.<br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>