diff options
-rw-r--r-- | backends/events/default/default-events.cpp | 2 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp index be0430b27f..9c33e187a4 100644 --- a/backends/events/default/default-events.cpp +++ b/backends/events/default/default-events.cpp @@ -237,6 +237,8 @@ DefaultEventManager::~DefaultEventManager() { _playbackFile = g_system->getSavefileManager()->openForLoading(_recordTempFileName.c_str()); + assert(_playbackFile); + _recordFile = g_system->getSavefileManager()->openForSaving(_recordFileName.c_str()); _recordFile->writeUint32LE(RECORD_SIGNATURE); _recordFile->writeUint32LE(RECORD_VERSION); diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index d4f634e62f..c11c97c041 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -468,12 +468,14 @@ void OSystem_SDL::quit() { free(_cursorPalette); free(_mouseData); - delete _savefile; delete _timer; SDL_Quit(); + // Even Manager requires save manager for storing + // recorded events delete getEventManager(); + delete _savefile; exit(0); } |