1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Fix potential crash on exit

This commit is contained in:
Ivan Savenko 2023-03-25 23:30:46 +02:00
parent 46461e5c33
commit c246cadaa7

View File

@ -1210,7 +1210,8 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, const CGTownInst
CCastleInterface::~CCastleInterface()
{
adventureInt->onAudioResumed();
if (adventureInt) // may happen on exiting client with open castle interface
adventureInt->onAudioResumed();
if(LOCPLINT->castleInt == this)
LOCPLINT->castleInt = nullptr;
}