]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkcombobox.c
Don't unref model if it is NULL. (#139770)
[~andy/gtk] / gtk / gtkcombobox.c
index 8126dd87fe66a82270861807574134a3c568dd4d..79942ee42c0f415e12452bcfb3941534aa0674d5 100644 (file)
@@ -361,6 +361,8 @@ static void     gtk_combo_box_cell_layout_reorder            (GtkCellLayout
 static gboolean gtk_combo_box_mnemonic_activate              (GtkWidget    *widget,
                                                              gboolean      group_cycling);
 
+static void     cell_view_sync_cells (GtkComboBox *combo_box,
+                                      GtkCellView *cell_view);
 
 GType
 gtk_combo_box_get_type (void)
@@ -1481,8 +1483,11 @@ gtk_combo_box_unset_model (GtkComboBox *combo_box)
                                (GtkCallback)gtk_widget_destroy, NULL);
     }
 
-  g_object_unref (G_OBJECT (combo_box->priv->model));
-  combo_box->priv->model = NULL;
+  if (combo_box->priv->model)
+    {
+      g_object_unref (G_OBJECT (combo_box->priv->model));
+      combo_box->priv->model = NULL;
+    }
 }
 
 static void
@@ -2458,6 +2463,10 @@ gtk_combo_box_list_key_press (GtkWidget   *widget,
            gtk_tree_path_free (path);
          }
       }
+
+    gtk_combo_box_popdown (combo_box);
+    
+    return TRUE;
   }
 
   return FALSE;