diff --git a/libopenage/engine/engine.cpp b/libopenage/engine/engine.cpp index c3a99859862..46964b5f848 100644 --- a/libopenage/engine/engine.cpp +++ b/libopenage/engine/engine.cpp @@ -43,11 +43,6 @@ Engine::Engine(mode mode, this->time_loop); } - this->threads.emplace_back([&]() { - this->time_loop->run(); - - this->time_loop.reset(); - }); this->threads.emplace_back([&]() { this->simulation->run(); @@ -57,6 +52,11 @@ Engine::Engine(mode mode, this->running = false; } }); + this->threads.emplace_back([&]() { + this->time_loop->run(); + + this->time_loop.reset(); + }); if (this->run_mode == mode::FULL) { this->threads.emplace_back([&]() { @@ -76,6 +76,7 @@ Engine::Engine(mode mode, void Engine::loop() { while (this->running) { // TODO + log::log(MSG(MIN) << "Prevent the loop from being optimized out by compiler"); } }