Skip to content

Commit

Permalink
Android: Add some missing codepaths when using Vulkan, might fix audi…
Browse files Browse the repository at this point in the history
…o/controller issues on task switching
  • Loading branch information
hrydgard committed Aug 8, 2017
1 parent 5e4e23f commit e268da8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 9 additions & 3 deletions android/src/org/ppsspp/ppsspp/NativeActivity.java
Expand Up @@ -549,14 +549,17 @@ protected void onDestroy() {
if (javaGL) {
Log.i(TAG, "onDestroy");
mGLSurfaceView.onDestroy();
NativeApp.audioShutdown();
// Probably vain attempt to help the garbage collector...
mGLSurfaceView = null;
audioFocusChangeListener = null;
audioManager = null;
unregisterCallbacks();
} else {
mSurfaceView.onDestroy();
mSurfaceView = null;
}
if (shuttingDown || isFinishing()) {
unregisterCallbacks();
NativeApp.audioShutdown();
NativeApp.shutdown();
initialized = false;
}
Expand Down Expand Up @@ -595,7 +598,6 @@ private boolean detectOpenGLES30() {
return info.reqGlEsVersion >= 0x30000;
}


@Override
protected void onResume() {
super.onResume();
Expand All @@ -614,6 +616,10 @@ protected void onResume() {
} else {
Log.e(TAG, "mGLSurfaceView really shouldn't be null in onResume");
}
} else {
if (mSurfaceView != null) {
mSurfaceView.onResume();
}
}

gainAudioFocus(this.audioManager, this.audioFocusChangeListener);
Expand Down
1 change: 1 addition & 0 deletions android/src/org/ppsspp/ppsspp/NativeSurfaceView.java
Expand Up @@ -133,6 +133,7 @@ public void onResume() {
}

public void onDestroy() {
Log.i(TAG, "onDestroy");
if (mController != null) {
mController.exit();
}
Expand Down

0 comments on commit e268da8

Please sign in to comment.