From 10181698424bb68bc60410f25174460974c34eb7 Mon Sep 17 00:00:00 2001 From: mittorn Date: Sat, 22 Jul 2017 13:51:07 +0700 Subject: [PATCH] Make force-quit after engine wait timeout --- src/in/celest/xash3d/XashService.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/in/celest/xash3d/XashService.java b/src/in/celest/xash3d/XashService.java index 00457d8b..ee8e1a52 100644 --- a/src/in/celest/xash3d/XashService.java +++ b/src/in/celest/xash3d/XashService.java @@ -47,8 +47,12 @@ public class XashService extends Service { public static class exitButtonListener extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { + XashActivity.mEngineReady = false; XashActivity.nativeUnPause(); XashActivity.nativeOnDestroy(); + if( XashActivity.mSurface != null ) + XashActivity.mSurface.engineThreadJoin(); + System.exit(0); } } @@ -104,11 +108,14 @@ public class XashService extends Service { @Override public void onTaskRemoved(Intent rootIntent) { Log.e("XashService", "OnTaskRemoved"); - if( XashActivity.mEngineReady ) + //if( XashActivity.mEngineReady ) { XashActivity.mEngineReady = false; XashActivity.nativeUnPause(); XashActivity.nativeOnDestroy(); + if( XashActivity.mSurface != null ) + XashActivity.mSurface.engineThreadJoin(); + System.exit(0); } stopSelf(); }