Skip to content

Commit

Permalink
Init MESSAGEMAN earlier (#96)
Browse files Browse the repository at this point in the history
It is undefined behaviour to call MESSAGEMAN->Broadcast before initialization (compilers are free to compile away the null check on MessageMan.cpp:209, and in fact g++ does, leading to a SIGSEGV on startup).
  • Loading branch information
hexpointer authored and MinaciousGrace committed Nov 15, 2017
1 parent 6b33880 commit dc484e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/StepMania.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,8 @@ int sm_main(int argc, char* argv[])

LUA = new LuaManager;
HOOKS->RegisterWithLua();

MESSAGEMAN = new MessageManager;

// Initialize the file extension type lists so everything can ask ActorUtil
// what the type of a file is.
Expand Down Expand Up @@ -1165,7 +1167,6 @@ int sm_main(int argc, char* argv[])
SONGMAN->UpdatePopular();
SONGMAN->UpdatePreferredSort();
NSMAN = new NetworkSyncManager( NULL );
MESSAGEMAN = new MessageManager;
STATSMAN = new StatsManager;

FILTERMAN = new FilterManager;
Expand Down

0 comments on commit dc484e6

Please sign in to comment.