Permalink
Browse files

Try a silly workaround for an otherwise unexplainable crash seen in G…

…oogle Play Console
  • Loading branch information...
hrydgard committed Dec 1, 2017
1 parent 8a06458 commit 5fbbb3e115c23e46bb6b533cc0de709f86bbbaf3
@@ -651,6 +651,17 @@ protected void onStop() {
protected void onDestroy() {
super.onDestroy();
if (javaGL) {
if (nativeRenderer.isRenderingFrame()) {
Log.i(TAG, "Waiting for renderer to finish.");
int tries = 200;
do {
try {
Thread.sleep(10);
} catch (InterruptedException e) {
}
tries--;
} while (nativeRenderer.isRenderingFrame() && tries > 0);
}
Log.i(TAG, "onDestroy");
mGLSurfaceView.onDestroy();
// Probably vain attempt to help the garbage collector...
@@ -32,7 +32,6 @@
public static native void pause();
public static native void resume();
// There's not really any reason to ever call shutdown as we can recover from a killed activity.
public static native void shutdown();
public static native boolean keyDown(int deviceId, int key, boolean isRepeat);
@@ -13,13 +13,20 @@
public class NativeRenderer implements GLSurfaceView.Renderer {
private static String TAG = "NativeRenderer";
private NativeActivity mActivity;
private boolean inFrame;
NativeRenderer(NativeActivity act) {
mActivity = act;
}
public boolean isRenderingFrame() {
return inFrame;
}
public void onDrawFrame(GL10 unused /*use GLES20*/) {
inFrame = true;
displayRender();
inFrame = false;
}
public void onSurfaceCreated(GL10 unused, EGLConfig config) {
@@ -2,7 +2,7 @@
#include "VulkanQueueRunner.h"
#include "VulkanRenderManager.h"
// Debug help: adb logcat -s DEBUG PPSSPPNativeActivity PPSSPP
// Debug help: adb logcat -s DEBUG PPSSPPNativeActivity PPSSPP NativeGLView NativeRenderer NativeSurfaceView PowerSaveModeReceiver InputDeviceState
void VulkanQueueRunner::CreateDeviceObjects() {
ILOG("VulkanQueueRunner::CreateDeviceObjects");

0 comments on commit 5fbbb3e

Please sign in to comment.