From 12b8dd2d9b4e3618033826a79f44441eda425b4a Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Thu, 8 Dec 2005 20:25:17 +0000 Subject: [PATCH] Fixed warning when exiting from non-Atlas game This was SVN commit r3211. --- source/tools/atlas/GameInterface/CommandProc.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/tools/atlas/GameInterface/CommandProc.cpp b/source/tools/atlas/GameInterface/CommandProc.cpp index 21e2baae3f..f5bad3948f 100644 --- a/source/tools/atlas/GameInterface/CommandProc.cpp +++ b/source/tools/atlas/GameInterface/CommandProc.cpp @@ -22,9 +22,12 @@ template void delete_fn(T* v) { delete v; } using namespace AtlasMessage; namespace AtlasMessage { - static CommandProc g_CommandProc; - CommandProc& GetCommandProc() { return g_CommandProc; } + CommandProc& GetCommandProc() + { + static CommandProc commandProc; + return commandProc; + } cmdHandlers& GetCmdHandlers() { @@ -45,6 +48,8 @@ CommandProc::CommandProc() CommandProc::~CommandProc() { + // Make sure Destroy has been called before now (to avoid + // problems from the destruction order of static variables) debug_assert(!m_Commands.size()); }