<div dir="ltr">You must be creating some other vtkObjects from somewhere else in your code that are not being cleaned up.<div><br></div><div>Can you set a breakpoint in the vtkObject::vtkObject constructor and see where you are creating them from? You should only hit that breakpoint from your Init_3D method if that is the only place where you are creating them from...<br>
<br></div><div><br><div class="gmail_quote">On Thu, Aug 14, 2008 at 11:53 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>
No, the DebugLeakReport appears when i close the application. Therefore i<br>
just include the vtkDebugLeaks.h<br>
<br>
the method that instantiates and delete the surrounding class is called from<br>
from a combobox and the whole method is:<br>
<br>
void ImageCtrl::Init_3D(void)<br>
{<br>
ImageVolumeData *vtkModul = new ImageVolumeData();<br>
<br>
delete vtkModul;<br>
<br>
return;<br>
}<br>
<br>
The class ImageCtrl is derived from CCmdTarget and handles the<br>
Messagerouting in the program.<br>
<br>
I debugged thought the code and watched the ProcessExplorers<br>
PrivateByteHistory of the running programm. I did the same in the<br>
vtkexamples and there everything works fine. I know it sounds strange and<br>
obviously it is a mistake on my side.<br>
<br>
Does anybody has an idea<br>
Andi<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
<br>
<br>
<br>
David Cole wrote:<br>
><br>
> Where is your code that instantiates/deletes the surrounding C++ class?<br>
> Are you saying that instantiating one of those and then deleting it<br>
> results<br>
> in a VTK mem leak report?<br>
><br>
><br>
> On Thu, Aug 14, 2008 at 10:48 AM, Andi2008 <<a href="mailto:mail-andi@web.de">mail-andi@web.de</a>> wrote:<br>
><br>
>><br>
>> thank you for the quick answer.But my case is different. I fixed the<br>
>> leaks<br>
>> he<br>
>> reported already by loading all vtl dlls delayed. I am using MFC too.<br>
>> Visual<br>
>> Studio report leaks only if i create vtkObjects.vtkDebugLeaks and the<br>
>> fact<br>
>> that the private byte history in the ProcessExplorer doesnt decrease<br>
>> after<br>
>> 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>
>><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>><br>
>> wrote:<br>
>> >> Hi,<br>
>> >><br>
>> >> yes it is me again and i still have questions about deleting<br>
>> 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<br>
>> 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<br>
>> of<br>
>> >> these class and delete it while i checked the private bytes history<br>
>> 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<br>
>> 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<br>
>> with<br>
>> >> the vtkExamples and there everything is fine and the memory always<br>
>> 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<br>
>> 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>
>> --<br>
>> View this message in context:<br>
>> <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>
>><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>
> 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>
</div></div>View this message in context: <a href="http://www.nabble.com/Delete-vtkObjects-tp18980765p18984404.html" target="_blank">http://www.nabble.com/Delete-vtkObjects-tp18980765p18984404.html</a><br>
<div><div></div><div class="Wj3C7c">Sent from the VTK - Users mailing list archive at Nabble.com.<br>
<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>