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 )
|
void CellWidget::unselectAll ( bool delayRedraw )
|
||||||
{
|
{
|
||||||
set<Selector*>::iterator iselector = _selectors.begin ();
|
set<Selector*>::iterator iselector;
|
||||||
for ( ; iselector != _selectors.end() ; iselector++ ) {
|
while ( !_selectors.empty() )
|
||||||
(*iselector)->detachFrom ( this );
|
(*_selectors.begin())->detachFrom ( this );
|
||||||
}
|
|
||||||
|
|
||||||
_selectionHasChanged = true;
|
_selectionHasChanged = true;
|
||||||
if ( !delayRedraw ) redraw ();
|
if ( !delayRedraw ) redraw ();
|
||||||
|
|
Loading…
Reference in New Issue