Always shut down audio, regardless of why the task is being destroyed. Might help #9771

This commit is contained in:
Henrik Rydgård 2017-08-08 13:03:23 +02:00
parent cefb57d778
commit 7a3a620ff2

View File

@ -91,6 +91,9 @@ public class NativeActivity extends Activity implements SurfaceHolder.Callback {
private Vibrator vibrator;
private boolean isXperiaPlay;
// This is to avoid losing the game/menu state etc when we are just
// switched-away from or rotated etc.
private boolean shuttingDown;
private static int RESULT_LOAD_IMAGE = 1;
@ -556,9 +559,9 @@ public class NativeActivity extends Activity implements SurfaceHolder.Callback {
mSurfaceView.onDestroy();
mSurfaceView = null;
}
NativeApp.audioShutdown();
if (shuttingDown || isFinishing()) {
unregisterCallbacks();
NativeApp.audioShutdown();
NativeApp.shutdown();
initialized = false;
}