aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
Diffstat (limited to 'backends')
-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;