mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-25 21:38:59 +02:00
Fix possibly hanging pointer to deleted CGObjectInstance
Was stored by CRemoveObjectOperation and accessed on destruction even though it has been removed by the game
This commit is contained in:
parent
f8e4e41c39
commit
62b564650d
@ -126,6 +126,9 @@ std::unique_ptr<CMap> CMapGenerator::generate()
|
||||
fillZones();
|
||||
//updated guarded tiles will be calculated in CGameState::initMapObjects()
|
||||
map->getZones().clear();
|
||||
|
||||
// undo manager keeps pointers to object that might be removed during gameplay. Remove them to prevent any hanging pointer after gameplay
|
||||
map->getEditManager()->getUndoManager().clearAll();
|
||||
}
|
||||
catch (rmgException &e)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user