diff options
author | Thanasis Antoniou | 2019-09-24 12:39:13 +0300 |
---|---|---|
committer | Thanasis Antoniou | 2019-09-24 12:40:18 +0300 |
commit | f79d5d9b6baa3e002c93df22d29eac62de3e618f (patch) | |
tree | 386a31fdec774144833a8f2ac14f2a2e62b8f370 /backends/platform/android | |
parent | ac0bae828ab1bc7fbef097398048e44ad6ac87a3 (diff) | |
download | scummvm-rg350-f79d5d9b6baa3e002c93df22d29eac62de3e618f.tar.gz scummvm-rg350-f79d5d9b6baa3e002c93df22d29eac62de3e618f.tar.bz2 scummvm-rg350-f79d5d9b6baa3e002c93df22d29eac62de3e618f.zip |
ANDROID: Use _system->destroy() instead of just delete in JNI::Destroy()
Diffstat (limited to 'backends/platform/android')
-rw-r--r-- | backends/platform/android/android.cpp | 2 | ||||
-rw-r--r-- | backends/platform/android/jni.cpp | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index 5614d0a95a..7513639f94 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -129,8 +129,6 @@ OSystem_Android::~OSystem_Android() { 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..2c27838f6a 100644 --- a/backends/platform/android/jni.cpp +++ b/backends/platform/android/jni.cpp @@ -562,9 +562,13 @@ void JNI::destroy(JNIEnv *env, jobject self) { delete _asset_archive; _asset_archive = 0; - delete _system; + // _system is a pointer of OSystem_Android <--- ModularBackend <--- BaseBacked <--- Common::OSystem + // It's better to call destroy() rather than just delete here + // to avoid mutex issues if a Common::String is used after this point + _system->destroy(); + g_system = 0; - _system = 0; + _system = 0; sem_destroy(&pause_sem); |