From cc03005c049d3dbdbda27975055dea5ae391085f Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Wed, 23 Feb 2005 00:01:23 +0000 Subject: Fixed Issue 143: Pbuffer creation in display() causes exception Fixed / worked around problem found by user mustang on the javagaming forums where if a recursive makeCurrent failed, it would incorrectly end up freeing the parent context. Not completely confident of this bug fix, but definitely fixes the mentioned problem and doesn't appear to break any of the demos. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@233 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/net/java/games/jogl/impl/GLContext.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/net/java/games') diff --git a/src/net/java/games/jogl/impl/GLContext.java b/src/net/java/games/jogl/impl/GLContext.java index aab3f9dd0..17667fbce 100644 --- a/src/net/java/games/jogl/impl/GLContext.java +++ b/src/net/java/games/jogl/impl/GLContext.java @@ -251,6 +251,15 @@ public abstract class GLContext { if (isReshape) { deferredReshapeAction = runnable; } + + // Clean up after ourselves on the way out. + // NOTE that this is an abbreviated version of the code below + // and should probably be refactored/cleaned up -- this bug + // fix was done without a lot of intense thought about the + // situation + if (curContext != null) { + curContext.makeCurrent(curInitAction); + } return; } if (DEBUG) { -- cgit v1.2.3