<div dir="ltr">Where is your code that instantiates/deletes the surrounding C++ class?<div><br></div><div>Are you saying that instantiating one of those and then deleting it results in a VTK mem leak report?</div><div><br>
<br><div class="gmail_quote">On Thu, Aug 14, 2008 at 10:48 AM, Andi2008 <span dir="ltr"><<a href="mailto:mail-andi@web.de">mail-andi@web.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
thank you for the quick answer.But my case is different. I fixed the leaks he<br>
reported already by loading all vtl dlls delayed. I am using MFC too. Visual<br>
Studio report leaks only if i create vtkObjects.vtkDebugLeaks and the fact<br>
that the private byte history in the ProcessExplorer doesnt decrease after i<br>
the objects tells me that the leaks come from vtk.<br>
<br>
I have no idea anymore what iam doing wrong.<br>
Andi<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
malat wrote:<br>
><br>
> Andreas,<br>
><br>
> I you are using MFC, I suggest to read the following post:<br>
><br>
> <a href="http://www.vtk.org/pipermail/vtkusers/2007-May/090968.html" target="_blank">http://www.vtk.org/pipermail/vtkusers/2007-May/090968.html</a><br>
><br>
> The non-compiling example you posted looks fine to me.<br>
><br>
> 2cts<br>
> -Mathieu<br>
><br>
> On Thu, Aug 14, 2008 at 2:41 PM, Andreas Brüning <<a href="mailto:mail-andi@web.de">mail-andi@web.de</a>> wrote:<br>
>> Hi,<br>
>><br>
>> yes it is me again and i still have questions about deleting vtkobjects<br>
>> :)<br>
>> Regarding to my post from Aug/12:<br>
>><br>
>> <a href="http://www.vtk.org/pipermail/vtkusers/2008-August/096455.html" target="_blank">http://www.vtk.org/pipermail/vtkusers/2008-August/096455.html</a><br>
>><br>
>> i still have problems to delete vtkobjects in my program and it is not<br>
>> only the thread issue. To encapsulate the whole vtk stuff i created it in<br>
>> a single class. I created some vtk objects in the constructor and call<br>
>> the Delete() method in the destructor for testing. Than i created one of<br>
>> these class and delete it while i checked the private bytes history on<br>
>> Sysinternals ProcessExplorer(which is by the way a great tool). I also<br>
>> enabled VTK_DEGUG_LEAKS.<br>
>> I thought when i delete the class the whole vtk stuff is gone but it is<br>
>> not. i can see no memory reduction in the process explorer and the<br>
>> DebugLeaks MessageBox tells me that always the objects remains. When i<br>
>> create a vtkPolyDataMapper there are even more. If i create more of my<br>
>> vtkClasses there are no changes in the memory but the debugleaks<br>
>> MessageBox report that all the vtkObjects remain in memory.<br>
>><br>
>> I really have no idea where is the mistake. I did the same procedure with<br>
>> the vtkExamples and there everything is fine and the memory always cleans<br>
>> up. I compared the project properies and they are the same.<br>
>><br>
>> Here is the code of my very short vtkClass:<br>
>><br>
>><br>
>> #include "StdAfx.h"<br>
>><br>
>> #include "ImageVolumeData.h"<br>
>><br>
>> #undef THIS_FILE<br>
>> static char BASED_CODE THIS_FILE[]=__FILE__;<br>
>><br>
>> #define new DEBUG_NEW<br>
>><br>
>><br>
>> ImageVolumeData::ImageVolumeData(void)<br>
>> {<br>
>> vtk_importer = vtkImageImport::New(); //global Variables defined<br>
>> in the header<br>
>> vtkflipper = vtkImageFlip::New();<br>
>><br>
>> //debugger = vtkDebugLeaks::New();<br>
>> ren = vtkRenderer::New();<br>
>><br>
>> }<br>
>><br>
>> ImageVolumeData::~ImageVolumeData(void)<br>
>> {<br>
>> vtk_importer->SetImportVoidPointer(NULL,0);<br>
>><br>
>> vtkflipper->Delete();<br>
>> vtk_importer->Delete();<br>
>><br>
>> ren->Delete();<br>
>><br>
>> }<br>
>><br>
>> I hope someone can give me an advice, i am running out of ideas<br>
>><br>
>> Thanks in advance<br>
>> Andi<br>
>> _____________________________________________________________________<br>
>> Der <a href="http://WEB.DE" target="_blank">WEB.DE</a> SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!<br>
>> <a href="http://smartsurfer.web.de/?mc=100071&distributionid=000000000066" target="_blank">http://smartsurfer.web.de/?mc=100071&distributionid=000000000066</a><br>
>><br>
>> _______________________________________________<br>
>> This is the private VTK discussion list.<br>
>> Please keep messages on-topic. Check the FAQ at:<br>
>> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><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>
>><br>
><br>
><br>
><br>
> --<br>
> Mathieu<br>
> _______________________________________________<br>
> This is the private VTK discussion list.<br>
> Please keep messages on-topic. Check the FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><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>
><br>
><br>
<br>
</div></div><font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/Delete-vtkObjects-tp18980765p18983087.html" target="_blank">http://www.nabble.com/Delete-vtkObjects-tp18980765p18983087.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
</font><div><div></div><div class="Wj3C7c"><br>
_______________________________________________<br>
This is the private VTK discussion list.<br>
Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><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></div></div>