# HG changeset patch # User serb # Date 1414773954 -10800 # Node ID ae0633fb37b1f2a18d2d0edad6a1decde021fc32 # Parent 95193f897702c1cc97fb3e0152397fb0aecb8e84 8057830: Crash in Java2D Queue Flusher, OGLSD_SetScratchSurface Reviewed-by: serb, denis Contributed-by: Hendrik Schreiber diff -r 95193f897702 -r ae0633fb37b1 src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m --- a/src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m Thu Oct 23 19:59:27 2014 +0400 +++ b/src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m Fri Oct 31 19:45:54 2014 +0300 @@ -72,7 +72,9 @@ } [pool drain]; free(ctxinfo); + oglc->ctxInfo = NULL; } + cglinfo->context = NULL; } free(cglinfo); diff -r 95193f897702 -r ae0633fb37b1 src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m --- a/src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m Thu Oct 23 19:59:27 2014 +0400 +++ b/src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m Fri Oct 31 19:45:54 2014 +0300 @@ -187,6 +187,11 @@ } OGLContext *oglc = cglInfo->context; + if (oglc == NULL) { + J2dRlsTraceLn(J2D_TRACE_ERROR, "OGLSD_SetScratchContext: ogl context is null"); + return NULL; + } + CGLCtxInfo *ctxinfo = (CGLCtxInfo *)oglc->ctxInfo; JNF_COCOA_ENTER(env);