diff options
author | Sven Göthel <[email protected]> | 2024-01-25 09:31:51 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-01-25 09:31:51 +0100 |
commit | 76487cd34ba706bee6c122a1cbbc75f5639eb4a4 (patch) | |
tree | e9d8c63800dc2e9989b7d1f01dae728a9cba1b3d /src/jogl/classes/jogamp/opengl/x11/glx | |
parent | b711ae5239b8581a197d468b2804cfeb8c4d6c94 (diff) |
NativeWindowFactory.createDevice(..) w/ unitID for cloning; DefaultGraphicsDevice: Move ownership (Object) code into base class ensuring same code
NativeWindowFactory.createDevice(..) w/ unitID
- Allows cloning a device instance with same parameter.
DefaultGraphicsDevice: Move ownership (Object) code final into base class ensuring same code
- Rename DefaultGraphicsDevice.swapDeviceHandleAndOwnership() -> swapHandleAndOwnership()
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/x11/glx')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java index ec1230894..ab4924516 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java @@ -206,9 +206,13 @@ public class X11GLXContext extends GLContextImpl { @Override protected void destroyContextARBImpl(final long ctx) { final long display = drawable.getNativeSurface().getDisplayHandle(); - - glXReleaseContext(display); - GLX.glXDestroyContext(display, ctx); + if( 0 != display ) { + glXReleaseContext(display); + GLX.glXDestroyContext(display, ctx); + } else { + final AbstractGraphicsDevice adev = drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice(); + throw new GLException("null display handle from device "+adev); + } } private static final int ctx_arb_attribs_idx_major = 0; private static final int ctx_arb_attribs_idx_minor = 2; |