mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
[editor] fix crash on quit with an opened map
This commit is contained in:
parent
9438c5f9f7
commit
b5cc3e8dc6
@ -58,6 +58,7 @@ void MapController::connectScenes()
|
||||
|
||||
MapController::~MapController()
|
||||
{
|
||||
main = nullptr;
|
||||
}
|
||||
|
||||
const std::unique_ptr<CMap> & MapController::getMapUniquePtr() const
|
||||
@ -229,6 +230,8 @@ void MapController::setMap(std::unique_ptr<CMap> cmap)
|
||||
|
||||
_map->getEditManager()->getUndoManager().setUndoCallback([this](bool allowUndo, bool allowRedo)
|
||||
{
|
||||
if(!main)
|
||||
return;
|
||||
main->enableUndo(allowUndo);
|
||||
main->enableRedo(allowRedo);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user