<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        mso-fareast-language:EN-GB;}
span.n
        {mso-style-name:n;}
span.o
        {mso-style-name:o;}
span.p
        {mso-style-name:p;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">parser->SetTarget(output);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">try calling
<o:p></o:p></span></p>
<pre><span class="n">parser</span><span class="o">-></span><span class="n">SetTarget</span><span class="p">(</span><span class="n">NULL</span><span class="p">);<o:p></o:p></span></pre>
<pre><span class="p"><o:p> </o:p></span></pre>
<pre><span class="p">before you delete. There might be a dangling reference held onto there…<o:p></o:p></span></pre>
<pre><span class="p"><o:p> </o:p></span></pre>
<pre><span class="p">just a thought as I was tired of work and glanced at your code. Probably no help.<o:p></o:p></span></pre>
<pre><span class="p"><o:p> </o:p></span></pre>
<pre><span class="p">JB</span><o:p></o:p></pre>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> vtk-developers-bounces@vtk.org [mailto:vtk-developers-bounces@vtk.org]
<b>On Behalf Of </b>Pat Marion<br>
<b>Sent:</b> 14 February 2012 16:26<br>
<b>To:</b> David Lonie<br>
<b>Cc:</b> VTK Developers<br>
<b>Subject:</b> Re: [vtk-developers] Leaks in the chemistry classes<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">One possible reference leak, do you need to call this->SetTarget(NULL) in the parser's destructor?<br>
<br>
Pat<o:p></o:p></p>
<div>
<p class="MsoNormal">On Mon, Feb 13, 2012 at 4:54 PM, David Lonie <<a href="mailto:loniedavid@gmail.com">loniedavid@gmail.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">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><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>