<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 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@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;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-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;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
        {mso-style-priority:99;
        mso-style-link:"E-mail Signature Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.E-mailSignatureChar
        {mso-style-name:"E-mail Signature Char";
        mso-style-priority:99;
        mso-style-link:"E-mail Signature";
        font-family:"Times New Roman","serif";}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</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-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='color:#1F497D'>One last experiment before I
leave for the weekend.&nbsp; If I start a blank C++ .NET project and run the same
code:<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>vtkImageData * image =
vtkImageData::New();<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>image-&gt;Delete();<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>then I get no memory leaks.&nbsp; I don&#8217;t
know anything about .NET really and would prefer to continue coding in straight
Visual C++. Does this mean that VTK 5 prefers .NET or is by default built for
it?&nbsp; Is the memory leakage I&#8217;m seeing somehow related to garbage collection or
the lack thereof in C++?<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>If ANYONE has answers, please
share!&nbsp; Thanks!<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><br>
Beau<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #91C0FF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Segoe UI","sans-serif"'>From:</span></b><span
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif"'> Beau Sapach
[mailto:beau.sapach@ualberta.ca] <br>
<b>Sent:</b> Friday, June 30, 2006 1:04 PM<br>
<b>To:</b> 'vtkusers@vtk.org'<br>
<b>Subject:</b> RE: Upgraded to 5.0, now memory leaks...<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span style='color:#1F497D'>Hello again everyone,<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>This is even more bizarre
now,&nbsp; it seems that if I create a blank MFC application (dialog based) in
Visual Studio I will get the same results as below, if I simply create a vtk
object and then delete it.<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>vtkImageData * image =
vtkImageData::New();<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>image-&gt;Delete();<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>these are the only two lines of
code under a single button on my form and I get the same huge list of memory
leaks.&nbsp; What&#8217;s going on??&nbsp; Does anyone know what&#8217;s causing
this?&nbsp; Is this possibly a false-positive issue?&nbsp; Many of the memory
leaks are for vtk objects that I&#8217;ve never even used, ever.&nbsp; Any help would
be much appreciated.&nbsp; Thanks!<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>Beau<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #91C0FF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Segoe UI","sans-serif"'>From:</span></b><span
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif"'> Beau Sapach
[mailto:beau.sapach@ualberta.ca] <br>
<b>Sent:</b> Friday, June 30, 2006 10:51 AM<br>
<b>To:</b> 'vtkusers@vtk.org'<br>
<b>Subject:</b> Upgraded to 5.0, now memory leaks...<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Hello everyone,<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I&#8217;ve just upgraded an application I&#8217;m developing to&nbsp;
VTK5 so that I can use the vtkAVIWriter.&nbsp; Seems to compile just fine now,
with a couple of minor tweaks.&nbsp; But on exiting I get a massive amount of
memory leaks.&nbsp; Is this possibly related to reference counting?&nbsp; Is
there a new way to delete objects in VTK 5?<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Beau<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Here is a snippet of the memory leak output from Visual
Studio:<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>Detected memory leaks!<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>Dumping objects -&gt;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{93220} normal block at 0x03247208, 12 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data: &lt;RAW_SCALARS &gt; 52 41 57 5F 53 43
41 4C 41 52 53 00 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{93219} normal block at 0x032470A0, 296 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data:
&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&gt; B4 20 18 10 01 00 00 00 00 CD CD CD BE 0F 00 00 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{92786} normal block at 0x031EC638, 12 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data: &lt;RAW_SCALARS &gt; 52 41 57 5F 53 43
41 4C 41 52 53 00 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{92785} normal block at 0x031EC4D0, 296 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data:
&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&gt; B4 20 18 10 01 00 00 00 00 CD CD CD D8 0E 00 00 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{92350} normal block at 0x03191A20, 12 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data: &lt;RAW_SCALARS &gt; 52 41 57 5F 53 43
41 4C 41 52 53 00 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{92349} normal block at 0x031918B8, 296 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data:
&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&gt; B4 20 18 10 01 00 00 00 00 CD CD CD F2 0D 00 00 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{91914} normal block at 0x030DED58, 12 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data: &lt;RAW_SCALARS &gt; 52 41 57 5F 53 43
41 4C 41 52 53 00 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{91913} normal block at 0x030DEBF0, 296 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data:
&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&gt; B4 20 18 10 01 00 00 00 00 CD CD CD 0C 0D 00 00 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{8728} normal block at 0x02B53A18, 36 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data:
&lt;&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&gt; 3C C8 17 10 01 00 00 00 00 CD CD CD 01 00 00 00 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{1084} normal block at 0x02AAE788, 16 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data: &lt;vtkXYPlotWidget &gt; 76 74 6B 58 59
50 6C 6F 74 57 69 64 67 65 74 00 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{1083} normal block at 0x02AAE738, 16 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data: &lt;vtkSplineWidget &gt; 76 74 6B 53 70
6C 69 6E 65 57 69 64 67 65 74 00 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{1082} normal block at 0x02AAE6E8, 16 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data: &lt;vtkSphereWidget &gt; 76 74 6B 53 70
68 65 72 65 57 69 64 67 65 74 00 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{1081} normal block at 0x02AAE698, 19 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data: &lt;vtkScalarBarWidg&gt; 76 74 6B 53 63
61 6C 61 72 42 61 72 57 69 64 67 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{1080} normal block at 0x02AAE648, 15 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data: &lt;vtkPointWidget &gt; 76 74 6B 50 6F
69 6E 74 57 69 64 67 65 74 00 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{1079} normal block at 0x02AAE5F8, 15 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data: &lt;vtkPlaneWidget &gt; 76 74 6B 50 6C
61 6E 65 57 69 64 67 65 74 00 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{1078} normal block at 0x02AAE5A0, 27 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data: &lt;vtkOrientationMa&gt; 76 74 6B 4F 72
69 65 6E 74 61 74 69 6F 6E 4D 61 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{1077} normal block at 0x02AAE550, 14 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>&nbsp;Data: &lt;vtkLineWidget &gt; 76 74 6B 4C 69 6E
65 57 69 64 67 65 74 00 <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>{1076} normal block at 0x02AAE4F8, 23 bytes long.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:8.0pt;font-family:"Courier New"'>&nbsp;Data:
&lt;vtkImplicitPlane&gt; 76 74 6B 49 6D 70 6C 69 63 69 74 50 6C 61 6E 65</span><o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>