From 5c432893f3efaf148da1b16ceed621ce265320bb Mon Sep 17 00:00:00 2001 From: auria Date: Sat, 2 Jan 2010 16:28:55 +0000 Subject: [PATCH] Gracefully exit when closing window git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4384 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/graphics/irr_driver.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index 5f5941acb..5913ee6f5 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -33,14 +33,15 @@ #include "guiengine/engine.hpp" #include "guiengine/modaldialog.hpp" #include "guiengine/screen.hpp" -#include "states_screens/state_manager.hpp" #include "io/file_manager.hpp" #include "items/item_manager.hpp" #include "items/powerup_manager.hpp" #include "items/attachment_manager.hpp" #include "items/projectile_manager.hpp" #include "karts/kart_properties_manager.hpp" +#include "main_loop.hpp" #include "modes/world.hpp" +#include "states_screens/state_manager.hpp" #include "utils/constants.hpp" using namespace irr::core; @@ -687,7 +688,10 @@ void IrrDriver::displayFPS() */ void IrrDriver::update(float dt) { - if(!m_device->run()) return; + if (!m_device->run()) + { + main_loop->abort(); + } m_device->getVideoDriver()->beginScene(false, true, video::SColor(255,100,101,140));