From 251687f795d0fe767ac52c6a9e5bfaa648919da2 Mon Sep 17 00:00:00 2001 From: truebrain Date: Tue, 3 Jan 2012 23:09:48 +0000 Subject: [PATCH] (svn r23746) -Fix: also set 'info' to NULL if 'instance' dies (for both AI and GS); avoids invalid memory reads --- src/ai/ai_core.cpp | 1 + src/game/game_core.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/ai/ai_core.cpp b/src/ai/ai_core.cpp index 6931accc7a..ed2945cf3b 100644 --- a/src/ai/ai_core.cpp +++ b/src/ai/ai_core.cpp @@ -104,6 +104,7 @@ delete c->ai_instance; c->ai_instance = NULL; + c->ai_info = NULL; cur_company.Restore(); diff --git a/src/game/game_core.cpp b/src/game/game_core.cpp index 5666180401..00930cacc1 100644 --- a/src/game/game_core.cpp +++ b/src/game/game_core.cpp @@ -94,6 +94,7 @@ delete Game::instance; Game::instance = NULL; + Game::info = NULL; cur_company.Restore();