diff options
author | Thierry Crozat | 2016-10-26 23:20:30 +0100 |
---|---|---|
committer | Thierry Crozat | 2016-10-29 15:13:32 +0100 |
commit | 3ae52a61afe2790bfd56c7eae8e06bcef52d926b (patch) | |
tree | 5d2ac0779580327072cc3fdecf04ee3729900c59 /base | |
parent | cbfa598446f656e5082f96458ee9540f1a58d180 (diff) | |
download | scummvm-rg350-3ae52a61afe2790bfd56c7eae8e06bcef52d926b.tar.gz scummvm-rg350-3ae52a61afe2790bfd56c7eae8e06bcef52d926b.tar.bz2 scummvm-rg350-3ae52a61afe2790bfd56c7eae8e06bcef52d926b.zip |
COMMON: Add referencing and destruction of the OSDMessageQueue instance
Registering the OSDMessageQueue instance as an event source is now done
right after the event manager is initialised. This ensures that it is created in a
sensible place and not for example in another thread). Also registering the
event source is moved to a separate function instead of being in the constructor
to remove any issue in case some code tries to display a OSD Message very early
on (the instance would be created then, but it would be registered as an event
source later).
Diffstat (limited to 'base')
-rw-r--r-- | base/main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/base/main.cpp b/base/main.cpp index 42f5910b3b..c52888a827 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -51,6 +51,7 @@ #include "common/textconsole.h" #include "common/tokenizer.h" #include "common/translation.h" +#include "common/osd_message_queue.h" #include "gui/gui-manager.h" #include "gui/error.h" @@ -477,6 +478,8 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { g_eventRec.RegisterEventSource(); #endif + Common::OSDMessageQueue::instance().registerEventSource(); + // Now as the event manager is created, setup the keymapper setupKeymapper(system); @@ -615,6 +618,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { GUI::GuiManager::destroy(); Common::ConfigManager::destroy(); Common::DebugManager::destroy(); + Common::OSDMessageQueue::destroy(); #ifdef ENABLE_EVENTRECORDER GUI::EventRecorder::destroy(); #endif |