1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Fix possible crash on deletion of adventureInt after GH on shutdown

This commit is contained in:
Ivan Savenko 2024-08-02 15:02:37 +00:00
parent 9f7abfe6e9
commit 46669e78e8

View File

@ -19,6 +19,7 @@
#include "../eventsSDL/InputHandler.h" #include "../eventsSDL/InputHandler.h"
#include "../CGameInfo.h" #include "../CGameInfo.h"
#include "../adventureMap/AdventureMapInterface.h"
#include "../render/Colors.h" #include "../render/Colors.h"
#include "../render/Graphics.h" #include "../render/Graphics.h"
#include "../render/IFont.h" #include "../render/IFont.h"
@ -145,7 +146,13 @@ CGuiHandler::CGuiHandler()
{ {
} }
CGuiHandler::~CGuiHandler() = default; CGuiHandler::~CGuiHandler()
{
// enforce deletion order on shutdown
// all UI elements including adventure map must be destroyed before Gui Handler
// proper solution would be removal of adventureInt global
adventureInt.reset();
}
ShortcutHandler & CGuiHandler::shortcuts() ShortcutHandler & CGuiHandler::shortcuts()
{ {