<div dir="ltr">Hi,<div><br></div><div>I am using vtkDebugLeaks. Using this example here: <a href="http://www.vtk.org/Wiki/VTK/Examples/Python/DataManipulation/Cube.py" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Python/DataManipulation/Cube.py</a>, if I <b>insert this line</b> : (after lines 10 and 82 in main function):</div><div><br></div><div>vtk.vtkDebugLeaks.PrintMemoryLeaks()</div><div><br></div><div>when, I run the script, I get the following on the console:</div><div><br></div><div><div>vtkDebugLeaks has detected LEAKS!</div><div>Class "vtkObjectFactoryCollection" has 1 instance still around.</div><div>Class "vtkBoxMuellerRandomSequence" has 1 instance still around.</div><div>Class "vtkMinimalStandardRandomSequence" has 1 instance still around.</div><div><br></div><div>vtkDebugLeaks has detected LEAKS!</div><div>Class "vtkObjectFactoryCollection" has 1 instance still around.</div><div>Class "vtkBoxMuellerRandomSequence" has 1 instance still around.</div><div>Class "vtkMinimalStandardRandomSequence" has 1 instance still around.</div><div><br></div><div>If I comment out all the del <python_obj> lines in the script, obviously I get a whole lot of memory leaks detected, as expected.</div><div><br></div><div>My question is about the 3 leaks detected as in the trace above, with all the del <python_obj> in place. </div><div><br></div><div>Are these 3 not leaks, but reports created by static initializers (as mentioned by David E DMarie here: <a href="http://vtk.1045678.n5.nabble.com/vtkDebugLeaks-problems-td5594643.html">http://vtk.1045678.n5.nabble.com/vtkDebugLeaks-problems-td5594643.html</a>).</div><div><br></div><div>Also, if I write a test case to ensure no memory leaks are reported, I cannot use the test: vtk.vtkDebugLeaks.PrintCurrentLeaks() == 0. Or if the above are indeed not leaks, but only reports, will vtk.vtkDebugLeaks.PrintCurrentLeaks() == 1 be a reliable test case?</div><div><br></div><div>I have attached 2 python scripts for reference, cube.py (with vtk.vtkDebugLeaks and del <<python_object>> statements in place) and cube_mem_leaks.py (vtk.vtkDebugLeaks and del <<python_object>> statements removed.)</div><div><br></div><div>Thanks,</div><div>Deepak</div><div><br></div>-- <br><div><a href="http://deepaksurti.com" target="_blank">http://deepaksurti.com</a><br>To see a miracle, be the miracle.</div>
</div></div>