# HG changeset patch
# User tdv
# Date 1224602738 25200
# Node ID 452c58b2f5334bb357f778e319b5dfffe7b4c696
# Parent  665850610378a6e9a46b7df1ce04d4fc6edfd236
6755274: 6u10b33 2d tests fails on sles10x64 with jvm crash
Reviewed-by: campbell

diff -r 665850610378 -r 452c58b2f533 src/solaris/classes/sun/java2d/opengl/GLXGraphicsConfig.java
--- openjdk.old/jdk/src/solaris/classes/sun/java2d/opengl/GLXGraphicsConfig.java	2010-08-30 11:47:11.000000000 +0200
+++ openjdk/jdk/src/solaris/classes/sun/java2d/opengl/GLXGraphicsConfig.java	2010-08-30 11:47:11.000000000 +0200
@@ -120,12 +120,14 @@
                 new GLXGetConfigInfo(device.getScreen(), visualnum);
             rq.flushAndInvokeNow(action);
             cfginfo = action.getConfigInfo();
-            OGLContext.setScratchSurface(cfginfo);
-            rq.flushAndInvokeNow(new Runnable() {
-                public void run() {
-                    ids[0] = OGLContext.getOGLIdString();
-                }
-            });
+            if (cfginfo != 0L) {
+                OGLContext.setScratchSurface(cfginfo);
+                rq.flushAndInvokeNow(new Runnable() {
+                    public void run() {
+                        ids[0] = OGLContext.getOGLIdString();
+                    }
+                });
+            }
         } finally {
             rq.unlock();
         }
diff -r 665850610378 -r 452c58b2f533 src/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java
--- openjdk-old/jdk/src/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java	2010-08-30 11:47:11.000000000 +0200
+++ openjdk/jdk/src/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java	2010-08-30 11:47:11.000000000 +0200
@@ -127,12 +127,14 @@
                 new WGLGetConfigInfo(device.getScreen(), pixfmt);
             rq.flushAndInvokeNow(action);
             cfginfo = action.getConfigInfo();
-            OGLContext.setScratchSurface(cfginfo);
-            rq.flushAndInvokeNow(new Runnable() {
-                public void run() {
-                    ids[0] = OGLContext.getOGLIdString();
-                }
-            });
+            if (cfginfo != 0L) {
+                OGLContext.setScratchSurface(cfginfo);
+                rq.flushAndInvokeNow(new Runnable() {
+                    public void run() {
+                        ids[0] = OGLContext.getOGLIdString();
+                    }
+                });
+            }
         } finally {
             rq.unlock();
         }
