[vtkusers] New crash bug! This time in vtkSeedWidget!
AGPX
agpxnet at yahoo.it
Fri Mar 26 08:58:52 EDT 2010
Hi,
just now, at the following link:
http://public.kitware.com/cgi-bin/viewcvs.cgi/Widgets/vtkSeedWidget.cxx?view=markup
that bug isn't fixed.
________________________________
Da: John Drescher <drescherjm at gmail.com>
A: AGPX <agpxnet at yahoo.it>
Cc: vtk vtk <vtkusers at vtk.org>
Inviato: Ven 26 marzo 2010, 13:53:50
Oggetto: Re: [vtkusers] New crash bug! This time in vtkSeedWidget!
On Fri, Mar 26, 2010 at 8:42 AM, AGPX <agpxnet at yahoo.it> wrote:
> Hi guys'n'gals,
>
> The method DeleteSeed of the class vtkSeedWidget crash:
>
> void vtkSeedWidget::DeleteSeed(int i)
> {
> if( this->Seeds->size() <= static_cast< size_t >(i) )
> {
> return;
> }
>
> vtkSeedRepresentation *rep =
> static_cast<vtkSeedRepresentation*>(this->WidgetRep);
> if (rep)
> {
> rep->RemoveHandle( i );
> }
>
> vtkSeedListIterator iter = this->Seeds->begin();
> vtkstd::advance(iter,i);
> (*iter)->SetEnabled(0);
> (*iter)->RemoveObservers(vtkCommand::StartInteractionEvent);
> (*iter)->RemoveObservers(vtkCommand::InteractionEvent);
> (*iter)->RemoveObservers(vtkCommand::EndInteractionEvent);
> vtkHandleWidget * w = (*iter);
> this->Seeds->erase( iter );
> w->Delete();
> }
>
> The problem is in the last two lines. You have to FIRST delete the object,
> then erase the relative iterator. That is you have to swap the last two
> lines:
>
> w->Delete();
> this->Seeds->erase( iter );
>
> Please fix it! Thanks.
>
> - AGPX
>
This is fixed in cvs.
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100326/b0defcf9/attachment.htm>
More information about the vtkusers
mailing list