diff options
-rw-r--r-- | engines/wage/wage.cpp | 11 | ||||
-rw-r--r-- | engines/wage/wage.h | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp index 3269039a1e..e8658101ef 100644 --- a/engines/wage/wage.cpp +++ b/engines/wage/wage.cpp @@ -78,6 +78,8 @@ WageEngine::WageEngine(OSystem *syst, const ADGameDescription *desc) : Engine(sy _commandWasQuick = false; + _shouldQuit = false; + debug("WageEngine::WageEngine()"); } @@ -85,6 +87,9 @@ WageEngine::~WageEngine() { debug("WageEngine::~WageEngine()"); DebugMan.clearAllDebugChannels(); + delete _world; + delete _resManager; + delete _gui; delete _rnd; } @@ -113,7 +118,9 @@ Common::Error WageEngine::run() { processTurn(&input, NULL); _temporarilyHidden = false; - while (true) { + _shouldQuit = false; + + while (!_shouldQuit) { processEvents(); _gui->draw(); @@ -138,7 +145,7 @@ void WageEngine::processEvents() { while (_eventMan->pollEvent(event)) { switch (event.type) { case Common::EVENT_QUIT: - error("Exiting"); + _shouldQuit = true; break; case Common::EVENT_MOUSEMOVE: _gui->mouseMove(event.mouse.x, event.mouse.y); diff --git a/engines/wage/wage.h b/engines/wage/wage.h index 724f39ab91..0c6f2e03c8 100644 --- a/engines/wage/wage.h +++ b/engines/wage/wage.h @@ -163,6 +163,7 @@ private: bool _commandWasQuick; + bool _shouldQuit; }; // Example console class |