diff options
author | Sven Gothel <[email protected]> | 2013-02-14 15:12:18 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-02-14 15:12:18 +0100 |
commit | f6e6fab2a7ddfb5c9b614cb072c27ff697629161 (patch) | |
tree | fc5928e2aa9dc58987813306933bf87e51d6e91b /src/jogl/classes | |
parent | d47794338ea218d1be2d21a91c8eea44d83dcb0a (diff) |
Fix OSX CALayer Bug 690 and Bug 691: Occasional Freeze on CVDisplayLinkStop; Layers and native GL-Context are _not_ Released ; Java Side wait for Main-Thread
- Fix Bug 690: Occasional Freeze on CVDisplayLinkStop
- NSOpenGLLayer.disableAnimation() shall not claim the renderLock mutex,
since the CVDisplayLink callback could be waiting for the lock.
This waiting callback could freeze the call to CVDisplayLinkStop.
- Fix Bug 691: Layers and native GL-Context are _not_ Released
- Following proper release cycle:
Context unrealized:
- JAWTWindow.detachSurfaceLayer() -> OSXUtil.RemoveCASublayer(..)
- CGL.releaseNSOpenGLLayer(..)
JAWTWindow.destroy()
- MacOSXJAWTWindow.UnsetJAWTRootSurfaceLayer(..)
- OSXUtil.DestroyCALayer(..)
- 'Magic' CALayer release calls (w/o manual retain beforehand) at:
- OSXUtil.RemoveCASublayer(..): [subLayer release]
- MacOSXJAWTWindow.UnsetJAWTRootSurfaceLayer(..): [rootLayer release]
- OSXUtil.DestroyCALayer(..): [rootLayer release]
- 'Magic' NSOpenGLLayer's NSOpenGLContext dealloc:
- [NSOpenGLContext clearDrawable]
- CGLDestroyContext( [NSOpenGLContext CGLContextObj] )
- Java Side wait for Main-Thread
- Waiting for the delegated Main-Thread on the Java side eases debugging
and won't block the Main-Thread in native code.
- Utilizing this for all CALayer calls
Test case: TestGLCanvasAddRemove01SwingAWT
Diffstat (limited to 'src/jogl/classes')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java index 838a0387d..0deaa2987 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java @@ -709,7 +709,10 @@ public abstract class MacOSXCGLContext extends GLContextImpl // still having a valid OLS attached to surface (parent OLS could have been removed) ols.detachSurfaceLayer(); } - CGL.releaseNSOpenGLLayer(nsOpenGLLayer); + OSXUtil.RunOnMainThread(true, new Runnable() { + public void run() { + CGL.releaseNSOpenGLLayer(nsOpenGLLayer); + } } ); if( null != gl3ShaderProgram ) { gl3ShaderProgram.destroy(MacOSXCGLContext.this.gl.getGL3()); gl3ShaderProgram = null; |