MantisBT - VTK | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0010374 | VTK | (No Category) | public | 2010-03-05 06:53 | 2013-04-05 20:14 |
| Reporter | Gianluca | ||||
| Assigned To | David Cole | ||||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | OS | OS Version | |||
| Product Version | |||||
| Target Version | Fixed in Version | ||||
| Project | |||||
| Type | |||||
| Summary | 0010374: vtkSeedRepresentation crash | ||||
| Description | I have compiled the latest version of VTK (from CVS) and the WidgetsCxxTests.exe (debug mode) crashs when you run Test15 (vtkSeedWidget). The error reported is: "list iterator not dereferencable" and the debugger show the line: ( *iter )->Delete(); The problem is in the following methods of the file vtkSeedRepresentation.cxx: /---------------------------------------------------------------------- void vtkSeedRepresentation::RemoveHandle( int n ) { // Remove nth handle if (n == this->ActiveHandle) { this->RemoveActiveHandle(); return; } if (static_cast<int>(this->Handles->size()) <= n ) { return; } vtkHandleListIterator iter = this->Handles->begin(); vtkstd::advance( iter, n ); this->Handles->erase( iter ); ( *iter )->Delete(); } //---------------------------------------------------------------------- void vtkSeedRepresentation::RemoveActiveHandle() { if ( this->Handles->size() < 1 ) { return; } if ( this->ActiveHandle >= 0 && this->ActiveHandle < static_cast<int>(this->Handles->size()) ) { vtkHandleListIterator iter = this->Handles->begin(); vtkstd::advance( iter, this->ActiveHandle ); this->Handles->erase( iter ); ( *iter )->Delete(); this->ActiveHandle = -1; } Basically the error are in the following lines: this->Handles->erase( iter ); ( *iter )->Delete(); You have to FIRST delete the object and THEN remove the handle! That is you have to swap the two lines: ( *iter )->Delete(); this->Handles->erase( iter ); Now the example no longer crash (and my application too!) | ||||
| Steps To Reproduce | |||||
| Additional Information | |||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | |||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2010-03-05 06:53 | Gianluca | New Issue | |||
| 2010-03-16 15:08 | David Cole | Status | backlog => tabled | ||
| 2010-03-16 15:08 | David Cole | Assigned To | => David Cole | ||
| 2010-03-16 15:08 | David Cole | Status | tabled => @80@ | ||
| 2010-03-16 15:08 | David Cole | Resolution | open => fixed | ||
| 2010-03-16 15:08 | David Cole | Status | @80@ => @20@ | ||
| 2010-03-16 15:08 | David Cole | Resolution | fixed => reopened | ||
| 2010-03-16 15:08 | David Cole | Note Added: 0019900 | |||
| 2010-03-16 15:08 | David Cole | Status | @20@ => @80@ | ||
| 2010-03-16 15:08 | David Cole | Resolution | reopened => fixed | ||
| 2010-03-23 09:08 | David Cole | Status | @80@ => @20@ | ||
| 2010-03-23 09:08 | David Cole | Resolution | fixed => reopened | ||
| 2010-03-23 09:11 | David Cole | Note Added: 0019984 | |||
| 2010-03-23 09:11 | David Cole | Status | @20@ => @80@ | ||
| 2010-03-23 09:11 | David Cole | Resolution | reopened => fixed | ||
| 2011-01-13 17:00 | Source_changeset_attached | => VTK master a2bd8391 | |||
| 2011-01-13 17:00 | Source_changeset_attached | => VTK master 020ef709 | |||
| 2011-06-16 13:11 | Zack Galbreath | Category | => (No Category) | ||
| 2013-04-05 20:14 | Berk Geveci | Status | customer review => closed | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||