diff options
author | Sven Gothel <[email protected]> | 2023-01-18 04:35:01 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-01-18 04:35:01 +0100 |
commit | 86460616271743970d1ffb2f64ee671e3deeb4cc (patch) | |
tree | 55e79fcca15a6e037a704806038784675203789d | |
parent | d55cc1f40820ae93e8ab0d5930514bc33b3e6a2f (diff) |
MacOSXCGLContext: Avoid data race on lastSetNSViewCmd, use local copy like in madeCurrent
-rw-r--r-- | src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java index 2c200b664..b577d8639 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java @@ -1052,9 +1052,10 @@ public class MacOSXCGLContext extends GLContextImpl OSXUtil.RunOnMainThread(false /* wait */, false /* kickNSApp */, cmd); } final boolean lockCGLContext; - if( null != lastSetNSViewCmd ) { - synchronized( lastSetNSViewCmd ) { - lockCGLContext = lastSetNSViewCmd.done; + final SetNSViewCmd _lastSetNSViewCmd = lastSetNSViewCmd; + if( null != _lastSetNSViewCmd ) { + synchronized( _lastSetNSViewCmd ) { + lockCGLContext = _lastSetNSViewCmd.done; if( lockCGLContext ) { lastSetNSViewCmd = null; // done, no more required } else if( DEBUG1398 ) { |