Access to free'd memory correction inside CellWidget::unselectAll().
Do not iterate over a STL set while erasing (all) elements... The set is stable over erasure, but if the iterator is pointing to the erased element we cannot do a "++". Increment first, erase after.
This commit is contained in:
parent
a54d86924f
commit
4c998aed83
|
@ -1188,10 +1188,9 @@ namespace Hurricane {
|
|||
|
||||
void CellWidget::unselectAll ( bool delayRedraw )
|
||||
{
|
||||
set<Selector*>::iterator iselector = _selectors.begin ();
|
||||
for ( ; iselector != _selectors.end() ; iselector++ ) {
|
||||
(*iselector)->detachFrom ( this );
|
||||
}
|
||||
set<Selector*>::iterator iselector;
|
||||
while ( !_selectors.empty() )
|
||||
(*_selectors.begin())->detachFrom ( this );
|
||||
|
||||
_selectionHasChanged = true;
|
||||
if ( !delayRedraw ) redraw ();
|
||||
|
|
Loading…
Reference in New Issue