One possible reference leak, do you need to call this->SetTarget(NULL) in the parser's destructor?<br><br>Pat<br><br><div class="gmail_quote">On Mon, Feb 13, 2012 at 4:54 PM, David Lonie <span dir="ltr"><<a href="mailto:loniedavid@gmail.com">loniedavid@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi List,<br>
<br>
Marcus and I have been trying to track down some memory leaks in the<br>
new Chemistry kit. The two that are left are:<br>
<br>
<a href="http://www.cdash.org/CDash/testDetails.php?test=134987704&build=2000996" target="_blank">http://www.cdash.org/CDash/testDetails.php?test=134987704&build=2000996</a><br>
<a href="http://www.cdash.org/CDash/testDetails.php?test=134987708&build=2000996" target="_blank">http://www.cdash.org/CDash/testDetails.php?test=134987708&build=2000996</a><br>
<br>
(The leaks:<br>
<br>
Class "vtkBlueObeliskData" has 1 instance still around.<br>
Class "vtkUnsignedShortArray" has 2 instances still around.<br>
Class "vtkFloatArray" has 10 instances still around.<br>
Class "vtkStringArray" has 7 instances still around.<br>
<br>
have been fixed, but the rest are still there.)<br>
<br>
The tests that generate these are here:<br>
<br>
<a href="http://github.com/Kitware/VTK/blob/master/Chemistry/Testing/Cxx/TestMoleculeSelection.cxx" target="_blank">http://github.com/Kitware/VTK/blob/master/Chemistry/Testing/Cxx/TestMoleculeSelection.cxx</a><br>
<a href="http://github.com/Kitware/VTK/blob/master/Chemistry/Testing/Cxx/TestCMLMoleculeReader.cxx" target="_blank">http://github.com/Kitware/VTK/blob/master/Chemistry/Testing/Cxx/TestCMLMoleculeReader.cxx</a><br>
<br>
When I enable debugging for the CMLMoleculeReader in the test script,<br>
I get the following:<br>
<br>
[test starts]<br>
[reader is created, vtkNew sets refcount = 1]<br>
[debugging is enabled]<br>
vtkCMLMoleculeReader (0x14457b0): Registered by<br>
vtkStreamingDemandDrivenPipeline (0x1473de0), ReferenceCount = 2<br>
vtkCMLMoleculeReader (0x14457b0): UnRegistered by NULL, ReferenceCount = 1<br>
/usr/src/vtk/build/bin/ChemistryCxxTests exited with code 0<br>
<br>
It looks like there is an instance of vtkStreamingDemandDrivenPipeline<br>
holding a reference to the reader that<br>
is leaking. Everything I'm allocating in the test uses vtkNew, so I'm<br>
thinking that I must be doing something wrong inside the reader wrt<br>
information-request handling. I've looked, but I don't see anything<br>
suspicious. Is the reader responsible for freeing anything it receives<br>
from the pipeline? The CML reader code that may have the bug is here:<br>
<br>
<a href="http://github.com/Kitware/VTK/blob/master/Chemistry/vtkCMLMoleculeReader.cxx" target="_blank">http://github.com/Kitware/VTK/blob/master/Chemistry/vtkCMLMoleculeReader.cxx</a><br>
<br>
I think something similar is happening with the MoleculeSelection<br>
test. I don't seen anything obvious or suspicious in the code -- can<br>
someone more familiar with the pipeline internals take a look at<br>
these?<br>
<br>
Thanks in advance,<br>
<br>
Dave<br>
_______________________________________________<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>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</blockquote></div><br>