changeset 10910:61e00d0b6a23

8057830: Crash in Java2D Queue Flusher, OGLSD_SetScratchSurface Reviewed-by: serb, denis Contributed-by: Hendrik Schreiber <hs@tagtraum.com>
author serb
date Fri, 31 Oct 2014 19:45:54 +0300
parents 7afec3ed5ab5
children 748091d834cf
files src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLGraphicsConfig.m src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLSurfaceData.m
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLGraphicsConfig.m	Fri Oct 31 12:38:46 2014 +0300
+++ b/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/src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLSurfaceData.m	Fri Oct 31 12:38:46 2014 +0300
+++ b/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);