MantisBT - VTK
View Issue Details
0010464VTK(No Category)public2010-03-26 08:422016-08-12 09:55
Gianluca 
Kitware Robot 
normalcrashalways
closedmoved 
 
 
0010464: vtkSeedWidget CRASH!!!
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
No tags attached.
Issue History
2010-03-26 08:42GianlucaNew Issue
2010-03-26 10:12GianlucaNote Added: 0020017
2010-04-20 17:22David DoriaNote Added: 0020305
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:55Kitware RobotNote Added: 0037156
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0020017)
Gianluca   
2010-03-26 10:12   
I cannot reproduce the problem. Probably isn't a bug. I'm sorry.
(0020305)
David Doria   
2010-04-20 17:22   
I also can't reproduce this. Fedora 12, g++ (GCC) 4.4.1.
(0037156)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.