aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanasis Antoniou2019-09-23 16:02:30 +0300
committerThanasis Antoniou2019-09-23 16:02:30 +0300
commitd39eca7e39f322b378845aba9ce7c09bc477987d (patch)
treed9a7e00a4d19ef8a51e0ca203a0235c67085b913
parent6bbfe9e21d67b6c690b03a0c161c4e7b25dd3dbf (diff)
downloadscummvm-rg350-d39eca7e39f322b378845aba9ce7c09bc477987d.tar.gz
scummvm-rg350-d39eca7e39f322b378845aba9ce7c09bc477987d.tar.bz2
scummvm-rg350-d39eca7e39f322b378845aba9ce7c09bc477987d.zip
ANDROID: Fix crash when exiting a game (Blade Runner)
-rw-r--r--backends/platform/android/android.cpp5
-rw-r--r--backends/platform/android/jni.cpp1
-rw-r--r--backends/platform/android/org/scummvm/scummvm/ScummVM.java3
3 files changed, 7 insertions, 2 deletions
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index a5dedb08eb..5614d0a95a 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -126,6 +126,11 @@ OSystem_Android::~OSystem_Android() {
_timerManager = 0;
deleteMutex(_event_queue_lock);
+
+ delete _savefileManager;
+ _savefileManager = 0;
+
+ ModularBackend::quit();
}
void *OSystem_Android::timerThreadFunc(void *arg) {
diff --git a/backends/platform/android/jni.cpp b/backends/platform/android/jni.cpp
index 5e4c116c82..db91fc7726 100644
--- a/backends/platform/android/jni.cpp
+++ b/backends/platform/android/jni.cpp
@@ -562,6 +562,7 @@ void JNI::destroy(JNIEnv *env, jobject self) {
delete _asset_archive;
_asset_archive = 0;
+ _system->quit();
delete _system;
g_system = 0;
_system = 0;
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVM.java b/backends/platform/android/org/scummvm/scummvm/ScummVM.java
index 2784623449..8dd974bbb8 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVM.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVM.java
@@ -141,11 +141,10 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
int res = main(_args);
- destroy();
-
deinitEGL();
deinitAudio();
+ destroy();
// On exit, tear everything down for a fresh restart next time.
System.exit(res);
}