From 3673964caf2c4ac4efddffb8d7e9c28cce49b48c Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 22 Mar 2013 10:31:27 +0100 Subject: NEWT/Android WindowDriver.closeNative0(..): Catch Exception at surface destroy allowing to continue destruction. --- .../classes/jogamp/newt/driver/android/WindowDriver.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') 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); -- cgit v1.2.3