aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLDrawable.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-03-28 00:56:44 +0000
committerKenneth Russel <[email protected]>2006-03-28 00:56:44 +0000
commitd90cb8e2808e4f1109befaac9512a19629adea53 (patch)
treee8260c665e62775ca64098ef50f64dad76849c54 /src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLDrawable.java
parent4a63dd74a3678e47b37f40dd844b56e69f21aa12 (diff)
Fixed lurking problem associated with on-screen contexts' makeCurrent
implementations on Windows and OS X where finally block should not cover lockSurface call; also fixed problem pointed out by Matt Abraham where if WindowsOnscreenGLDrawable.choosePixelFormat() threw an exception it would cause subsequent lockSurface() calls to fail git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@689 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLDrawable.java')
-rw-r--r--src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLDrawable.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLDrawable.java
index 08902b573..ee8393296 100644
--- a/src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/windows/WindowsOnscreenGLDrawable.java
@@ -194,7 +194,13 @@ public class WindowsOnscreenGLDrawable extends WindowsGLDrawable {
return LOCK_SURFACE_NOT_READY;
}
if (!pixelFormatChosen) {
- choosePixelFormat(true);
+ try {
+ choosePixelFormat(true);
+ } catch (RuntimeException e) {
+ // Make it look like the lockSurface() call didn't succeed
+ unlockSurface();
+ throw e;
+ }
}
if (PROFILING) {
long endTime = System.currentTimeMillis();