<div dir="ltr">Thanks. I finally solved my problem by changing all pointers to smart pointers. I think the problem was that inside an object referenced with a normal pointer there were other objects with smart pointer, so when I deleted the main object, then the other objects still remained. Thanks anyway.<div>
<br></div><div>Ignacio </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 28, 2014 at 11:06 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Remove the Delete</p>
<div class="gmail_quote"><div><div class="h5">On Jan 28, 2014 10:00 AM, "Jose Ignacio Prieto" <<a href="mailto:joseignacio.prieto@gmail.com" target="_blank">joseignacio.prieto@gmail.com</a>> wrote:<br type="attribution">
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<div dir="ltr">Hi all,<div>I am having a release only bug I haven't been able to trace. It happens when I create an object in a smartpointer, delete it and then create again. <br><div>I am using a class derived from vtkDistanceWidget. It is stored in a vtkSmartPointer inside a interactor observer derived class.</div>
<div>The deletion method inside interactorobserver is like this:<br clear="all"><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">this</span><span>-></span><span style="color:rgb(128,0,0)">m_ellipsoidWidget</span><span>-></span><span>ReleaseFocus</span><span>();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">this</span><span>-></span><span style="color:rgb(128,0,0)">m_ellipsoidWidget</span><span>-></span><span style="font-style:italic">Delete</span><span>();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span>And the creation method </span><span style="font-family:arial">inside interactorobserver </span><span style="font-family:arial">is:</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">this</span><span>-></span><span style="color:rgb(128,0,0)">m_ellipsoidWidget</span><span style="color:rgb(192,192,192)"> </span><span>=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">vtkSmartPointer</span><span><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">epxVtkEllipsoidWidget</span><span>>::</span><span>New</span><span>();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">this</span><span>-></span><span style="color:rgb(128,0,0)">m_ellipsoidWidget</span><span>-></span><span>SetDebug</span><span>(</span><span style="color:rgb(0,0,128)">1</span><span>);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">this</span><span>-></span><span style="color:rgb(128,0,0)">m_ellipsoidWidget</span><span>-></span><span style="font-style:italic">SetInteractor</span><span>(</span><span style="font-family:arial;color:rgb(128,128,0)">this</span><span style="font-family:arial;color:rgb(192,192,192)"> </span><span style="font-family:arial">-></span><span style="font-style:italic;font-family:arial">GetInteractor</span><span style="font-family:arial">()</span><span style="font-family:arial">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial;color:rgb(192,192,192)"> </span><span style="font-family:arial;color:rgb(128,128,0)">this</span><span style="font-family:arial">-></span><span style="font-family:arial;color:rgb(128,0,0)">m_ellipsoidWidget</span><span style="font-family:arial">-></span><span style="font-style:italic;font-family:arial">SetCurrentRenderer</span><span style="font-family:arial">(</span><span style="font-family:arial;color:rgb(128,128,0)">this</span><span style="font-family:arial">-></span><span style="font-family:arial;color:rgb(128,0,0)">win</span><span style="font-family:arial">-></span><span style="font-family:arial;color:rgb(128,0,0)">ren</span><span style="font-family:arial">);</span><br>
</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">this</span><span>-></span><span style="color:rgb(128,0,0)">m_ellipsoidWidget</span><span>-></span><span style="font-style:italic">SetEnabled</span><span>(</span><span style="color:rgb(0,0,128)">1</span><span>);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><font face="arial"><span style="white-space:normal">The problem is that I can't find the error on debug mode, it only appears on release. I tried to set both methods under a try-catch block with std::exception but they are not caught. Setting console output I figured out it breaks after the SetDebug line. What can it be?? </span></font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><font face="arial"><span style="white-space:normal">Thank you very much, I have no clue on this.</span></font></pre><pre style="margin-top:0px;margin-bottom:0px">
<font face="arial"><span style="white-space:normal"><br></span></font></pre><pre style="margin-top:0px;margin-bottom:0px"><font face="arial"><span style="white-space:normal">Ignacio Prieto</span></font></pre><pre style="margin-top:0px;margin-bottom:0px">
<font face="arial"><span style="white-space:normal"><br></span></font></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span></pre>
</pre></div>-- <br>Ignacio Prieto<br>Software Developer</div></div><div>Biomedical Imaging Center</div><div>Pontificia Universidad Católica de Chile</div></div>
<br></div></div>_______________________________________________<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>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>José Ignacio Prieto<br>celular(nuevo): 94348182
</div>