[Scummvm-git-logs] scummvm master -> 5c9879688980d5659e3148afb318be57ef59d827

lephilousophe noreply at scummvm.org
Sat Dec 9 22:29:12 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5c98796889 ANDROID: Kill ourselves if the main thread failed to join


Commit: 5c9879688980d5659e3148afb318be57ef59d827
    https://github.com/scummvm/scummvm/commit/5c9879688980d5659e3148afb318be57ef59d827
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-12-09T23:28:48+01:00

Commit Message:
ANDROID: Kill ourselves if the main thread failed to join

This should avoid the infamous assertion fault with _system not being
null.

Changed paths:
    backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java


diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
index 85d56a421dd..de6f7529cee 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
@@ -24,6 +24,7 @@ import android.os.Build;
 import android.os.Bundle;
 import android.os.Environment;
 import android.os.ParcelFileDescriptor;
+import android.os.Process;
 import android.os.SystemClock;
 import android.provider.DocumentsContract;
 import android.text.TextUtils;
@@ -1093,11 +1094,16 @@ public class ScummVMActivity extends Activity implements OnKeyboardVisibilityLis
 			_scummvm.setPause(false);
 			try {
 				// 1s timeout
-				_scummvm_thread.join(1000);
+				_scummvm_thread.join(2000);
 			} catch (InterruptedException e) {
 				Log.i(ScummVM.LOG_TAG, "Error while joining ScummVM thread", e);
 			}
 
+			// Our join failed: kill ourselves to not have two ScummVM running at the same time
+			if (_scummvm_thread.isAlive()) {
+				Process.killProcess(Process.myPid());
+			}
+
 			_finishing = false;
 			_scummvm = null;
 		}




More information about the Scummvm-git-logs mailing list