From d450abb40bf63bdd78411167505fb7fbc070dcc6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 20 Aug 2021 20:36:55 -0700 Subject: [PATCH] AGS: Properly destroy platform driver on exit --- .../ags/engine/platform/scummvm/scummvm_platform_driver.cpp | 2 ++ engines/ags/globals.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/engines/ags/engine/platform/scummvm/scummvm_platform_driver.cpp b/engines/ags/engine/platform/scummvm/scummvm_platform_driver.cpp index 437788b8ed9..d5cb5549634 100644 --- a/engines/ags/engine/platform/scummvm/scummvm_platform_driver.cpp +++ b/engines/ags/engine/platform/scummvm/scummvm_platform_driver.cpp @@ -37,6 +37,8 @@ namespace AGS3 { using AGS::Shared::String; struct ScummVMPlatformDriver : AGSPlatformDriver { + virtual ~ScummVMPlatformDriver() {} + int CDPlayerCommand(int cmdd, int datt) override; void DisplayAlert(const char *, ...) override; const char *GetAllUsersDataDirectory() override; diff --git a/engines/ags/globals.cpp b/engines/ags/globals.cpp index 7c8e62725b9..6ea6b299f69 100644 --- a/engines/ags/globals.cpp +++ b/engines/ags/globals.cpp @@ -87,6 +87,7 @@ #include "ags/engine/main/graphics_mode.h" #include "ags/engine/media/audio/ambient_sound.h" #include "ags/engine/media/audio/audio_defines.h" +#include "ags/engine/platform/base/ags_platform_driver.h" #include "ags/engine/script/cc_instance.h" #include "ags/engine/script/executing_script.h" #include "ags/engine/script/non_blocking_script_function.h" @@ -359,6 +360,9 @@ Globals::Globals() { Globals::~Globals() { g_globals = nullptr; + // ags_platform_driver.cpp globals + delete _platform; + // ags_plugin.cpp globals delete _glVirtualScreenWrap;