diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/platform/dingux/main.cpp | 4 | ||||
-rw-r--r-- | backends/platform/samsungtv/samsungtv.cpp | 10 | ||||
-rw-r--r-- | backends/platform/samsungtv/samsungtv.h | 3 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 66 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.h | 2 |
5 files changed, 38 insertions, 47 deletions
diff --git a/backends/platform/dingux/main.cpp b/backends/platform/dingux/main.cpp index 91899a55cf..c5dccc5f50 100644 --- a/backends/platform/dingux/main.cpp +++ b/backends/platform/dingux/main.cpp @@ -46,7 +46,9 @@ int main(int argc, char* argv[]) { // Invoke the actual ScummVM main entry point: int res = scummvm_main(argc, argv); - ((OSystem_SDL_Dingux *)g_system)->deinit(); + + // Free OSystem + delete (OSystem_SDL_Dingux *)g_system; return res; } diff --git a/backends/platform/samsungtv/samsungtv.cpp b/backends/platform/samsungtv/samsungtv.cpp index b007d1d594..77993881df 100644 --- a/backends/platform/samsungtv/samsungtv.cpp +++ b/backends/platform/samsungtv/samsungtv.cpp @@ -67,14 +67,4 @@ bool OSystem_SDL_SamsungTV::getFeatureState(Feature f) { } } -void OSystem_SDL_SamsungTV::fatalError() { - // FIXME - for (;;) {} -} - -void OSystem_SDL_SamsungTV::quit() { - // FIXME - deinit(); -} - #endif diff --git a/backends/platform/samsungtv/samsungtv.h b/backends/platform/samsungtv/samsungtv.h index c5c8a4f65a..bccb6baee9 100644 --- a/backends/platform/samsungtv/samsungtv.h +++ b/backends/platform/samsungtv/samsungtv.h @@ -37,9 +37,6 @@ public: virtual bool hasFeature(Feature f); virtual void setFeatureState(Feature f, bool enable); virtual bool getFeatureState(Feature f); - - virtual void fatalError(); - virtual void quit(); }; #endif diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 1fb600b1de..f31f7f81bd 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -79,7 +79,33 @@ OSystem_SDL::OSystem_SDL() } OSystem_SDL::~OSystem_SDL() { - deinit(); + SDL_ShowCursor(SDL_ENABLE); + + 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; +#endif + + delete _logger; + _logger = 0; + + SDL_Quit(); } void OSystem_SDL::init() { @@ -200,36 +226,6 @@ void OSystem_SDL::initSDL() { } } -void OSystem_SDL::deinit() { - SDL_ShowCursor(SDL_ENABLE); - - 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; -#endif - - delete _logger; - _logger = 0; - - SDL_Quit(); -} - void OSystem_SDL::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) { #ifdef DATA_PATH @@ -364,10 +360,16 @@ void OSystem_SDL::setWindowCaption(const char *caption) { } void OSystem_SDL::quit() { - deinit(); + delete this; exit(0); } +void OSystem_SDL::fatalError() { + delete this; + exit(1); +} + + void OSystem_SDL::logMessage(LogMessageType::Type type, const char *message) { ModularBackend::logMessage(type, message); if (_logger) diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 9a69bed691..7c82159d40 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -63,7 +63,7 @@ public: virtual void initBackend(); virtual Common::HardwareKeySet *getHardwareKeySet(); virtual void quit(); - virtual void deinit(); + virtual void fatalError(); // Logging virtual void logMessage(LogMessageType::Type type, const char *message); |