Skip to content

Commit

Permalink
ANDROID: Remove duplicate _system->quit() from JNI::Destroy()
Browse files Browse the repository at this point in the history
Since it is already called in Jni::main after scummvm_main() returns. The second call in destroy caused crashes on some devices.
  • Loading branch information
antoniou79 committed Sep 23, 2019
1 parent d39eca7 commit b4b9ad1
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion backends/platform/android/jni.cpp
Expand Up @@ -562,7 +562,6 @@ void JNI::destroy(JNIEnv *env, jobject self) {
delete _asset_archive;
_asset_archive = 0;

_system->quit();
delete _system;

This comment has been minimized.

Copy link
@criezy

criezy Sep 23, 2019

Member

Is _system something that derives from Common::OSystem? If so you might want to call _system->destroy() instead of doing delete _system (otherwise you might have mutex issues if a Common::String is used after this point).

This comment has been minimized.

Copy link
@antoniou79

antoniou79 Sep 23, 2019

Author Contributor

Yes, it derives from ModularBackend, which derives from BaseBackend and that one derives from Common::OSystem. It's also assigned to g_system which is a pointer to Common::OSystem. Maybe it would be more readable to do a g_system->destroy() there instead

g_system = 0;
_system = 0;
Expand Down

0 comments on commit b4b9ad1

Please sign in to comment.