changeset 10277:ae0633fb37b1

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 95193f897702
children 6572a5107052
files src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);
--- 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);