aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLe Philousophe2019-09-30 07:30:15 +0200
committerLe Philousophe2019-10-09 13:33:11 +0200
commitc27199496c8408d76dbaed497ebe5d9f352b4339 (patch)
treeebde78ba3bd0b540febf1310cb428422c89f1d39
parentbe4dd18dbc070292c061791fe0581a978baf8162 (diff)
downloadscummvm-rg350-c27199496c8408d76dbaed497ebe5d9f352b4339.tar.gz
scummvm-rg350-c27199496c8408d76dbaed497ebe5d9f352b4339.tar.bz2
scummvm-rg350-c27199496c8408d76dbaed497ebe5d9f352b4339.zip
WII: Destroy everything before exiting
That let's close virtual keyboard file.
-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();