<br><br><div class="gmail_quote">On Tue, Nov 23, 2010 at 10:46 AM, David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div class="im"><br>
</div>If I do this (which works fine (no crash)):<br>
<div class="im"><br>
  vtkSmartPointer&lt;vtkFloatArray&gt; distances =<br>
    vtkSmartPointer&lt;vtkFloatArray&gt;::New();<br>
  std::cout &lt;&lt; distances-&gt;GetNumberOfComponents() &lt;&lt; std::endl;<br>
<br>
</div>  distances.TakeReference(vtkFloatArray::New());<br>
<div class="im">  std::cout &lt;&lt; distances-&gt;GetNumberOfComponents() &lt;&lt; std::endl;<br>
<br>
</div>there is a leak, right? The first vtkFloatArray object is never<br>
deleted. How do you delete the memory allocated to the first object?<br>
(This is why I had tried calling Delete(), which you say should never<br>
be done (and I agree, as it causes a crash every time :) )<br></blockquote><div><br>Are you sure there is a leak?  Why do you think the first FloatArray isn&#39;t being deleted?  Show me the evidence!<br><br>  David <br>

</div></div>