From 33531f146a5f92af65b458b422e673692806cecd Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 21 Aug 2019 08:39:53 +0200 Subject: JoglVersion.getGLInfo: Increase robustness of debug output --- src/jogl/classes/com/jogamp/opengl/GLProfile.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/jogl/classes/com/jogamp/opengl/GLProfile.java') diff --git a/src/jogl/classes/com/jogamp/opengl/GLProfile.java b/src/jogl/classes/com/jogamp/opengl/GLProfile.java index 0e0d45444..9b96adf71 100644 --- a/src/jogl/classes/com/jogamp/opengl/GLProfile.java +++ b/src/jogl/classes/com/jogamp/opengl/GLProfile.java @@ -2031,11 +2031,14 @@ public class GLProfile { final GLContext ctx = factory.getOrCreateSharedContext(device); if(null != ctx) { System.err.println("GLProfile.dumpGLInfo: "+ctx); - ctx.makeCurrent(); - try { - System.err.println(JoglVersion.getGLInfo(ctx.getGL(), null)); - } finally { - ctx.release(); + if( GLContext.CONTEXT_NOT_CURRENT != ctx.makeCurrent() ) { + try { + System.err.println(JoglVersion.getGLInfo(ctx.getGL(), null)); + } finally { + ctx.release(); + } + } else { + System.err.println("GLProfile.dumpGLInfo: Couldn't make context current"); } } else { System.err.println("GLProfile.dumpGLInfo: shared context n/a"); -- cgit v1.2.3