From 4918fea2ba4d1c8ce0bf7302bf9817aaafdc5269 Mon Sep 17 00:00:00 2001 From: milek7 Date: Sun, 20 Aug 2017 17:37:05 +0200 Subject: [PATCH] move sound_manager new/delete into main --- EU07.cpp | 7 +++++++ World.cpp | 10 ---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/EU07.cpp b/EU07.cpp index ef539605..c73f92b3 100644 --- a/EU07.cpp +++ b/EU07.cpp @@ -346,6 +346,12 @@ int main(int argc, char *argv[]) || (false == UILayer.init(window))) return -1; + if (!(sound_man = new sound_manager())) + { + ErrorLog("Sound subsystem setup failed"); + return -1; + } + input::Keyboard.init(); input::Mouse.init(); input::Gamepad.init(); @@ -409,6 +415,7 @@ int main(int argc, char *argv[]) #endif } + delete sound_man; TPythonInterpreter::killInstance(); #ifdef _WIN32 delete pConsole; diff --git a/World.cpp b/World.cpp index 1ddcac08..1ba003f3 100644 --- a/World.cpp +++ b/World.cpp @@ -218,7 +218,6 @@ TWorld::~TWorld() Global::bManageNodes = false; // Ra: wyłączenie wyrejestrowania, bo się sypie TrainDelete(); // Ground.Free(); //Ra: usunięcie obiektów przed usunięciem dźwięków - sypie się - delete sound_man; } void TWorld::TrainDelete(TDynamicObject *d) @@ -302,15 +301,6 @@ bool TWorld::Init( GLFWwindow *Window ) { UILayer.set_background( "logo" ); - sound_man = new sound_manager(); - - if (!sound_man) - { - ErrorLog( "Sound subsystem setup failed" ); - return false; - } - WriteLog("SoundAL Init OK"); - glfwSetWindowTitle( window, ( Global::AppName + " (" + Global::SceneryFile + ")" ).c_str() ); // nazwa scenerii UILayer.set_progress(0.01); UILayer.set_progress( "Loading scenery / Wczytywanie scenerii" );