[vtkusers] New crash bug! This time in vtkSeedWidget!

Dave Partyka dave.partyka at kitware.com
Fri Mar 26 09:09:24 EDT 2010


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.

On Fri, Mar 26, 2010 at 8:58 AM, AGPX <agpxnet at yahoo.it> wrote:

> 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
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100326/a9bca7f8/attachment.htm>


More information about the vtkusers mailing list