aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2010-11-29 16:22:04 +0000
committerMax Horn2010-11-29 16:22:04 +0000
commitf0fdff21f641097ea0bd18493580b42ed12dac6a (patch)
treebca9b9b44f1f0277dbf50cc54679e44264a1fe09
parentdf05ed1a46516f7e4d5c6e78f7f096208dbad790 (diff)
downloadscummvm-rg350-f0fdff21f641097ea0bd18493580b42ed12dac6a.tar.gz
scummvm-rg350-f0fdff21f641097ea0bd18493580b42ed12dac6a.tar.bz2
scummvm-rg350-f0fdff21f641097ea0bd18493580b42ed12dac6a.zip
SDL: Revert r54554, and add explanatory comment (fix for bug #3121841)
svn-id: r54574
-rw-r--r--backends/modular-backend.cpp2
-rw-r--r--backends/platform/sdl/sdl.cpp16
2 files changed, 17 insertions, 1 deletions
diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp
index 347c5d69a0..4159a83ab0 100644
--- a/backends/modular-backend.cpp
+++ b/backends/modular-backend.cpp
@@ -40,8 +40,8 @@ ModularBackend::ModularBackend()
}
ModularBackend::~ModularBackend() {
- delete _eventManager;
delete _graphicsManager;
+ delete _eventManager;
delete _mixer;
delete _audiocdManager;
delete _savefileManager;
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 561e5b2aec..8d9694b4f7 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -81,10 +81,26 @@ OSystem_SDL::OSystem_SDL()
OSystem_SDL::~OSystem_SDL() {
SDL_ShowCursor(SDL_ENABLE);
+ // Delete the various managers here. Note that the ModularBackend
+ // destructor would also take care of this for us. However, various
+ // of our managers must be deleted *before* we call SDL_Quit().
+ // Hence, we perform the destruction on our own.
+ delete _savefileManager;
+ _savefileManager = 0;
+ delete _graphicsManager;
+ _graphicsManager = 0;
+ delete _eventManager;
+ _eventManager = 0;
delete _eventSource;
_eventSource = 0;
+ delete _audiocdManager;
+ _audiocdManager = 0;
delete _mixerManager;
_mixerManager = 0;
+ delete _timerManager;
+ _timerManager = 0;
+ delete _mutexManager;
+ _mutexManager = 0;
#ifdef USE_OPENGL
delete[] _graphicsModes;