<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:Courier New,courier,monaco,monospace,sans-serif;font-size:10pt"><div>Hi,<br><br>just now, at the following link:<br><br><a href="http://public.kitware.com/cgi-bin/viewcvs.cgi/Widgets/vtkSeedWidget.cxx?view=markup">http://public.kitware.com/cgi-bin/viewcvs.cgi/Widgets/vtkSeedWidget.cxx?view=markup</a><br></div><div style="font-family: Courier New,courier,monaco,monospace,sans-serif; font-size: 10pt;"><br>that bug isn't fixed.<br><br><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">Da:</span></b> John Drescher &lt;drescherjm@gmail.com&gt;<br><b><span style="font-weight: bold;">A:</span></b> AGPX &lt;agpxnet@yahoo.it&gt;<br><b><span style="font-weight: bold;">Cc:</span></b> vtk vtk &lt;vtkusers@vtk.org&gt;<br><b><span style="font-weight:
 bold;">Inviato:</span></b> Ven 26 marzo 2010, 13:53:50<br><b><span style="font-weight: bold;">Oggetto:</span></b> Re: [vtkusers] New crash bug! This time in vtkSeedWidget!<br></font><br>On Fri, Mar 26, 2010 at 8:42 AM, AGPX &lt;<a ymailto="mailto:agpxnet@yahoo.it" href="mailto:agpxnet@yahoo.it">agpxnet@yahoo.it</a>&gt; wrote:<br>&gt; Hi guys'n'gals,<br>&gt;<br>&gt; The method DeleteSeed of the class vtkSeedWidget crash:<br>&gt;<br>&gt; void vtkSeedWidget::DeleteSeed(int i)<br>&gt; {<br>&gt; &nbsp; if( this-&gt;Seeds-&gt;size() &lt;= static_cast&lt; size_t &gt;(i) )<br>&gt; &nbsp;&nbsp;&nbsp; {<br>&gt; &nbsp;&nbsp;&nbsp; return;<br>&gt; &nbsp;&nbsp;&nbsp; }<br>&gt;<br>&gt; &nbsp; vtkSeedRepresentation *rep =<br>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; static_cast&lt;vtkSeedRepresentation*&gt;(this-&gt;WidgetRep);<br>&gt; &nbsp; if (rep)<br>&gt; &nbsp;&nbsp;&nbsp; {<br>&gt; &nbsp;&nbsp;&nbsp; rep-&gt;RemoveHandle( i );<br>&gt; &nbsp;&nbsp;&nbsp;
 }<br>&gt;<br>&gt; &nbsp; vtkSeedListIterator iter = this-&gt;Seeds-&gt;begin();<br>&gt; &nbsp; vtkstd::advance(iter,i);<br>&gt; &nbsp; (*iter)-&gt;SetEnabled(0);<br>&gt; &nbsp; (*iter)-&gt;RemoveObservers(vtkCommand::StartInteractionEvent);<br>&gt; &nbsp; (*iter)-&gt;RemoveObservers(vtkCommand::InteractionEvent);<br>&gt; &nbsp; (*iter)-&gt;RemoveObservers(vtkCommand::EndInteractionEvent);<br>&gt; &nbsp; vtkHandleWidget * w = (*iter);<br>&gt; &nbsp; this-&gt;Seeds-&gt;erase( iter );<br>&gt; &nbsp; w-&gt;Delete();<br>&gt; }<br>&gt;<br>&gt; The problem is in the last two lines. You have to FIRST delete the object,<br>&gt; then erase the relative iterator. That is you have to swap the last two<br>&gt; lines:<br>&gt;<br>&gt; &nbsp; w-&gt;Delete();<br>&gt; &nbsp; this-&gt;Seeds-&gt;erase( iter );<br>&gt;<br>&gt; Please fix it! Thanks.<br>&gt;<br>&gt; - AGPX<br>&gt;<br>This is fixed in cvs.<br><br>John<br></div></div>
</div><br>



      </body></html>