changeset 3294:78364959fc73

6963357: After clicking the "Load" button,the case FileDialogUserFilterTest.html crashes in jdk7 b98. Reviewed-by: dcherepanov
author dav
date Wed, 29 Dec 2010 17:36:31 +0300
parents 8b05f9b91765
children aa03f76d0e80
files src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Wed Dec 29 15:13:00 2010 +0300
+++ b/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) {