diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index 9bf902dde..d9dee9580 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -1586,6 +1586,11 @@ void IrrDriver::update(float dt) return; } + // If we quit via the menu the m_device->run() does not return true. + // To avoid any other calls, we return here. + if(main_loop->isAborted()) + return; + // If the resolution should be switched, do it now. This will delete the // old device and create a new one. if (m_resolution_changing!=RES_CHANGE_NONE) diff --git a/src/main_loop.hpp b/src/main_loop.hpp index f2a376ad6..2819a07f6 100644 --- a/src/main_loop.hpp +++ b/src/main_loop.hpp @@ -39,6 +39,9 @@ public: ~MainLoop(); void run(); void abort(); + // ------------------------------------------------------------------------ + /** Returns true if STK is to be stoppe. */ + bool isAborted() const { return m_abort; } }; // MainLoop extern MainLoop* main_loop;