diff options
author | Kenneth Russel <[email protected]> | 2004-04-23 16:15:05 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2004-04-23 16:15:05 +0000 |
commit | 33073d36be0932f7a15cf04e3b42ef53a80337b8 (patch) | |
tree | 7d1c5d8690d8128a7ebc700edb3f4fdce5dfc800 /src/net/java/games | |
parent | 3b48c5696d5372fa48ebb2b3c0246a7980924c5d (diff) |
Worked around incidence of 4796548 on Mac OS X
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@121 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games')
-rw-r--r-- | src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java b/src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java index f87aa5668..cb75fe166 100644 --- a/src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java +++ b/src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java @@ -45,6 +45,8 @@ import java.util.*; import net.java.games.jogl.*; import net.java.games.jogl.impl.*; +import java.security.*; + public class MacOSXOnscreenGLContext extends MacOSXGLContext { // Variables for lockSurface/unlockSurface private JAWT_DrawingSurface ds; @@ -55,6 +57,9 @@ public class MacOSXOnscreenGLContext extends MacOSXGLContext { // Variables for pbuffer support List pbuffersToInstantiate = new ArrayList(); + // Workaround for instance of 4796548 + private boolean firstLock = true; + public MacOSXOnscreenGLContext(Component component, GLCapabilities capabilities, GLCapabilitiesChooser chooser, @@ -189,7 +194,16 @@ public class MacOSXOnscreenGLContext extends MacOSXGLContext { } } - dsi = ds.GetDrawingSurfaceInfo(); + if (firstLock) { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + dsi = ds.GetDrawingSurfaceInfo(); + return null; + } + }); + } else { + dsi = ds.GetDrawingSurfaceInfo(); + } if (dsi == null) { ds.Unlock(); getJAWT().FreeDrawingSurface(ds); @@ -199,6 +213,8 @@ public class MacOSXOnscreenGLContext extends MacOSXGLContext { return false; } + firstLock = false; + macosxdsi = (JAWT_MacOSXDrawingSurfaceInfo) dsi.platformInfo(); if (macosxdsi == null) { ds.FreeDrawingSurfaceInfo(dsi); |