From a565a27da8c5278846c06585cb6e218ff8f0f1b7 Mon Sep 17 00:00:00 2001 From: Jason Felds <jafelds@gmail.com> Date: Sun, 13 Dec 2015 11:24:17 -0500 Subject: [PATCH] Instantiate MESSAGEMAN first. This fixes a well-formed warning, but does it break anything? It's not clear off hand. Having this up for discussion. --- src/MessageManager.cpp | 3 +-- src/StepMania.cpp | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/StepMania.cpp b/src/StepMania.cpp index a7c1b2383a..28ad6548b3 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -1058,8 +1058,10 @@ int sm_main(int argc, char* argv[]) // This needs PREFSMAN. Dialog::Init(); - // Create game objects + // Set up the messaging system early to have well defined code. + MESSAGEMAN = new MessageManager; + // Create game objects GAMESTATE = new GameState; // This requires PREFSMAN, for PREFSMAN->m_bShowLoadingWindow. @@ -1180,7 +1182,6 @@ int sm_main(int argc, char* argv[]) SONGMAN->UpdatePopular(); SONGMAN->UpdatePreferredSort(); NSMAN = new NetworkSyncManager( pLoadingWindow ); - MESSAGEMAN = new MessageManager; STATSMAN = new StatsManager; // Initialize which courses are ranking courses here. diff --git a/src/MessageManager.cpp b/src/MessageManager.cpp index 66a3a7b3ff..97d5cc9e59 100644 --- a/src/MessageManager.cpp.orig 2016-08-10 23:15:24.000000000 +0000 +++ b/src/MessageManager.cpp 2018-10-21 15:58:42.411346628 +0000 @@ -207,8 +207,7 @@ void MessageManager::Broadcast( Message &msg ) const { - // GAMESTATE is created before MESSAGEMAN, and has several BroadcastOnChangePtr members, so they all broadcast when they're initialized. - if(this != NULL && m_Logging) + if(m_Logging) { LOG->Trace("MESSAGEMAN:Broadcast: %s", msg.GetName().c_str()); }