summaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r--src/newt/classes/com/jogamp/newt/impl/WindowImpl.java18
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java12
2 files changed, 26 insertions, 4 deletions
diff --git a/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java b/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java
index f9383ea38..0eb8f9644 100644
--- a/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java
+++ b/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java
@@ -149,10 +149,19 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer, ScreenMod
/**
* Invoked before Window destroy action,
- * allows releasing of resources depending on the native Window.
+ * allows releasing of resources depending on the native Window.<br>
+ * Surface not locked yet.<br>
+ * Called not necessarily from EDT.
+ */
+ void destroyActionPreLock(boolean unrecoverable);
+
+ /**
+ * Invoked before Window destroy action,
+ * allows releasing of resources depending on the native Window.<br>
+ * Surface locked.<br>
* Called from EDT.
*/
- void destroyAction(boolean unrecoverable);
+ void destroyActionInLock(boolean unrecoverable);
/** Only informal, when starting reparenting */
void reparentActionPre();
@@ -640,7 +649,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer, ScreenMod
}
if(null!=lifecycleHook) {
- lifecycleHook.destroyAction(unrecoverable);
+ lifecycleHook.destroyActionInLock(unrecoverable);
}
// Now us ..
@@ -680,6 +689,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer, ScreenMod
//Exception ee = new Exception(msg);
//ee.printStackTrace();
}
+ if(null!=lifecycleHook) {
+ lifecycleHook.destroyActionPreLock(unrecoverable);
+ }
DestroyAction destroyAction = new DestroyAction(unrecoverable);
runOnEDTIfAvail(true, destroyAction);
}
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index aef4de92a..f6901e54a 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -278,7 +278,17 @@ public class GLWindow implements GLAutoDrawable, Window {
DisposeAction disposeAction = new DisposeAction();
/** Window.LifecycleHook */
- public synchronized void destroyAction(boolean unrecoverable) {
+ public synchronized void destroyActionPreLock(boolean unrecoverable) {
+ GLAnimatorControl animator = GLWindow.this.getAnimator();
+ // since we have no 'recreation model' for dispose here yet,
+ // we simply stop the animator if started.
+ if(null!=animator && animator.isStarted()) {
+ animator.stop();
+ }
+ }
+
+ /** Window.LifecycleHook */
+ public synchronized void destroyActionInLock(boolean unrecoverable) {
if(Window.DEBUG_WINDOW_EVENT || Window.DEBUG_IMPLEMENTATION) {
String msg = new String("GLWindow.destroy("+unrecoverable+") "+Thread.currentThread()+", start");
System.err.println(msg);