8057830: Crash in Java2D Queue Flusher, OGLSD_SetScratchSurface
Reviewed-by: serb, denis
Contributed-by: Hendrik Schreiber <hs@tagtraum.com>
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLGraphicsConfig.m Fri Oct 31 12:38:46 2014 +0300
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/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);
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLSurfaceData.m Fri Oct 31 12:38:46 2014 +0300
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/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);