2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-25 11:19:59 +01:00

Make force-quit after engine wait timeout

This commit is contained in:
mittorn 2017-07-22 13:51:07 +07:00
parent 06359502e1
commit 1018169842

View File

@ -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();
}