<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 <drescherjm@gmail.com><br><b><span style="font-weight: bold;">A:</span></b> AGPX <agpxnet@yahoo.it><br><b><span style="font-weight: bold;">Cc:</span></b> vtk vtk <vtkusers@vtk.org><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 <<a ymailto="mailto:agpxnet@yahoo.it" href="mailto:agpxnet@yahoo.it">agpxnet@yahoo.it</a>> wrote:<br>> Hi guys'n'gals,<br>><br>> The method DeleteSeed of the class vtkSeedWidget crash:<br>><br>> void vtkSeedWidget::DeleteSeed(int i)<br>> {<br>> if( this->Seeds->size() <= static_cast< size_t >(i) )<br>> {<br>> return;<br>> }<br>><br>> vtkSeedRepresentation *rep =<br>> static_cast<vtkSeedRepresentation*>(this->WidgetRep);<br>> if (rep)<br>> {<br>> rep->RemoveHandle( i );<br>>
}<br>><br>> vtkSeedListIterator iter = this->Seeds->begin();<br>> vtkstd::advance(iter,i);<br>> (*iter)->SetEnabled(0);<br>> (*iter)->RemoveObservers(vtkCommand::StartInteractionEvent);<br>> (*iter)->RemoveObservers(vtkCommand::InteractionEvent);<br>> (*iter)->RemoveObservers(vtkCommand::EndInteractionEvent);<br>> vtkHandleWidget * w = (*iter);<br>> this->Seeds->erase( iter );<br>> w->Delete();<br>> }<br>><br>> The problem is in the last two lines. You have to FIRST delete the object,<br>> then erase the relative iterator. That is you have to swap the last two<br>> lines:<br>><br>> w->Delete();<br>> this->Seeds->erase( iter );<br>><br>> Please fix it! Thanks.<br>><br>> - AGPX<br>><br>This is fixed in cvs.<br><br>John<br></div></div>
</div><br>
</body></html>