I can commit this, but before I do, can anyone tell me if this case is reproducible in a current test (I don't see it failing on the dashboard so it probably doesn't have any testing coverage) or willing to provide a simple test the reproduces this.<br>
<br><div class="gmail_quote">On Fri, Mar 26, 2010 at 8:58 AM, AGPX <span dir="ltr"><<a href="mailto:agpxnet@yahoo.it">agpxnet@yahoo.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><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" target="_blank">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><div class="hm"><br><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:13px">
<div class="hm"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight:bold">Da:</span></b> John Drescher <<a href="mailto:drescherjm@gmail.com" target="_blank">drescherjm@gmail.com</a>><br><b><span style="font-weight:bold">A:</span></b> AGPX <<a href="mailto:agpxnet@yahoo.it" target="_blank">agpxnet@yahoo.it</a>><br>
<b><span style="font-weight:bold">Cc:</span></b> vtk vtk <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><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></div><div><div></div><div class="h5"><br>On Fri, Mar 26, 2010 at 8:42 AM, AGPX <<a href="mailto:agpxnet@yahoo.it" target="_blank">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></div>
</div><br>
</div><br>_______________________________________________<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><br>