6963357: After clicking the "Load" button,the case FileDialogUserFilterTest.html crashes in jdk7 b98.
authordav
Wed, 29 Dec 2010 17:36:31 +0300
changeset 7774 279c38a42ae5
parent 7773 d714591bc2f0
child 7775 c75bf08f7e0c
6963357: After clicking the "Load" button,the case FileDialogUserFilterTest.html crashes in jdk7 b98. Reviewed-by: dcherepanov
jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c
--- a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Wed Dec 29 15:13:00 2010 +0300
+++ b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Wed Dec 29 17:36:31 2010 +0300
@@ -191,7 +191,7 @@
 
     fp_gdk_threads_enter();
 
-    const char *title = (*env)->GetStringUTFChars(env, jtitle, 0);
+    const char *title = jtitle == NULL? "": (*env)->GetStringUTFChars(env, jtitle, 0);
 
     if (mode == 1) {
         /* Save action */
@@ -212,7 +212,9 @@
         }
     }
 
-    (*env)->ReleaseStringUTFChars(env, jtitle, title);
+    if (jtitle != NULL) {
+      (*env)->ReleaseStringUTFChars(env, jtitle, title);
+    }
 
     /* Set the directory */
     if (jdir != NULL) {