From 7a3a620ff2bc38e0a34120d9ef4b9b650fd2d96e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 8 Aug 2017 13:03:23 +0200 Subject: [PATCH] Always shut down audio, regardless of why the task is being destroyed. Might help #9771 --- android/src/org/ppsspp/ppsspp/NativeActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/android/src/org/ppsspp/ppsspp/NativeActivity.java b/android/src/org/ppsspp/ppsspp/NativeActivity.java index 4f88c62828..d34ff48c5a 100644 --- a/android/src/org/ppsspp/ppsspp/NativeActivity.java +++ b/android/src/org/ppsspp/ppsspp/NativeActivity.java @@ -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; }