6804221: Three tests for JTabbedPane produce VM crash on rhel3
authorpeterz
Tue, 24 Feb 2009 19:17:51 +0300
changeset 2487 f1744cd208ba
parent 2486 c22da29c4b59
child 2488 4d54c9133cda
6804221: Three tests for JTabbedPane produce VM crash on rhel3 Reviewed-by: stayer, campbell
jdk/src/solaris/native/sun/awt/gtk2_interface.c
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Mon Feb 23 11:16:04 2009 -0800
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Tue Feb 24 19:17:51 2009 +0300
@@ -93,6 +93,7 @@
 /* Static buffer for conversion from java.lang.String to UTF-8 */
 static char convertionBuffer[CONV_BUFFER_SIZE];
 
+static gboolean new_combo = TRUE;
 const char ENV_PREFIX[] = "GTK_MODULES=";
 
 /*******************/
@@ -608,6 +609,7 @@
             dlsym(gtk2_libhandle, "gtk_combo_box_entry_new");
         if (fp_gtk_combo_box_entry_new == NULL) {
             fp_gtk_combo_box_entry_new = dl_symbol("gtk_combo_new");
+            new_combo = FALSE;
         }
 
         fp_gtk_separator_tool_item_new =
@@ -1423,17 +1425,13 @@
             */
             GtkWidget *combo = (*fp_gtk_combo_box_entry_new)();
 
-            if (widget_type == COMBO_BOX_TEXT_FIELD)
-                (*fp_gtk_container_add)((GtkContainer *)combo, result);
-            else
-            {
+            if (new_combo && widget_type == COMBO_BOX_ARROW_BUTTON) {
                 (*fp_gtk_widget_set_parent)(result, combo);
                 ((GtkBin*)combo)->child = result;
+            } else {
+                (*fp_gtk_container_add)((GtkContainer *)combo, result);
             }
-
             (*fp_gtk_container_add)((GtkContainer *)gtk2_fixed, combo);
-            (*fp_gtk_widget_realize)(result);
-            return result;
         }
         else if (widget_type != TOOL_TIP &&
                  widget_type != INTERNAL_FRAME &&