aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/newt/classes/jogamp/newt/driver/android/WindowDriver.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java
index 8002c49b3..8f9ee1c0f 100644
--- a/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java
@@ -376,11 +376,17 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
setupInputListener(false);
if(0 != eglSurface) {
- final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) getScreen().getDisplay().getGraphicsDevice();
- if (!EGL.eglDestroySurface(eglDevice.getHandle(), eglSurface)) {
- throw new GLException("Error destroying window surface (eglDestroySurface)");
+ try {
+ final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) getScreen().getDisplay().getGraphicsDevice();
+ if (!EGL.eglDestroySurface(eglDevice.getHandle(), eglSurface)) {
+ throw new GLException("Error destroying window surface (eglDestroySurface)");
+ }
+ } catch (Throwable t) {
+ Log.d(MD.TAG, "closeNativeImpl: Catch exception "+t.getMessage());
+ t.printStackTrace();
+ } finally {
+ eglSurface = 0;
}
- eglSurface = 0;
}
release0(surfaceHandle);