aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/wii/main.cpp3
-rw-r--r--backends/platform/wii/osystem.cpp9
2 files changed, 12 insertions, 0 deletions
diff --git a/backends/platform/wii/main.cpp b/backends/platform/wii/main.cpp
index d33e968c64..e5d3e74c3a 100644
--- a/backends/platform/wii/main.cpp
+++ b/backends/platform/wii/main.cpp
@@ -230,6 +230,9 @@ int main(int argc, char *argv[]) {
res = scummvm_main(argc, argv);
g_system->quit();
+ g_system->destroy();
+ g_system = nullptr;
+
printf("shutdown\n");
SYS_UnregisterResetFunc(&resetinfo);
diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp
index c2751f6ef4..54427bd20c 100644
--- a/backends/platform/wii/osystem.cpp
+++ b/backends/platform/wii/osystem.cpp
@@ -145,7 +145,16 @@ void OSystem_Wii::initBackend() {
}
void OSystem_Wii::quit() {
+ /* Delete _timerManager before deinitializing events as it's tied */
+ delete _timerManager;
+ _timerManager = nullptr;
+
deinitEvents();
+
+ /* Delete _eventManager before destroying FS to avoid problems when releasing virtual keyboard data */
+ delete _eventManager;
+ _eventManager = nullptr;
+
deinitSfx();
deinitGfx();