From b5cc3e8dc662a15b91547de123a974987890fc51 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Thu, 13 Jun 2024 06:46:41 +0300 Subject: [PATCH] [editor] fix crash on quit with an opened map --- mapeditor/mapcontroller.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mapeditor/mapcontroller.cpp b/mapeditor/mapcontroller.cpp index e0ddc71ec..a5fecd21a 100644 --- a/mapeditor/mapcontroller.cpp +++ b/mapeditor/mapcontroller.cpp @@ -58,6 +58,7 @@ void MapController::connectScenes() MapController::~MapController() { + main = nullptr; } const std::unique_ptr & MapController::getMapUniquePtr() const @@ -229,6 +230,8 @@ void MapController::setMap(std::unique_ptr cmap) _map->getEditManager()->getUndoManager().setUndoCallback([this](bool allowUndo, bool allowRedo) { + if(!main) + return; main->enableUndo(allowUndo); main->enableRedo(allowRedo); }