Fix deletion bug in Selector::_preDestroy().

* Bug: In Selector::_preDestroy(), *do not* iterate over the _cellWidgets
    map as we destroy it's elements! We end up in destroyed ones...
    Instead destroy the first one until the map is empty.
This commit is contained in:
Jean-Paul Chaput 2022-01-26 19:34:31 +01:00
parent a5d92ecc29
commit 7f936367f8
1 changed files with 2 additions and 1 deletions

View File

@ -118,7 +118,8 @@ namespace Hurricane {
void Selector::_preDestroy()
{
for ( auto iwidget : _cellWidgets ) detachFrom( iwidget.first, true );
while ( not _cellWidgets.empty() )
detachFrom( _cellWidgets.begin()->first, true );
PrivateProperty::_preDestroy();
}