Explorar o código

Fix potential crash on exit

Ivan Savenko %!s(int64=2) %!d(string=hai) anos
pai
achega
c246cadaa7
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      client/windows/CCastleInterface.cpp

+ 2 - 1
client/windows/CCastleInterface.cpp

@@ -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;
 }