From f705d0a5fa9b5d0fc2ef04151e9c7649761a8906 Mon Sep 17 00:00:00 2001 From: Daniel Boles Date: Fri, 20 Jan 2017 21:07:26 +0000 Subject: [PATCH] =?UTF-8?q?combobox:=20If=20typechecking,=20don=E2=80=99t?= =?UTF-8?q?=20reference=20before?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gtk/gtkcombobox.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index e97be5baa1..f04b7ae3ff 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -2304,7 +2304,7 @@ void gtk_combo_box_popup_for_device (GtkComboBox *combo_box, GdkDevice *device) { - GtkComboBoxPrivate *priv = combo_box->priv; + GtkComboBoxPrivate *priv; gint x, y, width, height; GtkTreePath *path = NULL, *ppath; GtkWidget *toplevel; @@ -2313,6 +2313,8 @@ gtk_combo_box_popup_for_device (GtkComboBox *combo_box, g_return_if_fail (GTK_IS_COMBO_BOX (combo_box)); g_return_if_fail (GDK_IS_DEVICE (device)); + priv = combo_box->priv; + if (!gtk_widget_get_realized (GTK_WIDGET (combo_box))) return; @@ -2432,10 +2434,12 @@ gtk_combo_box_real_popdown (GtkComboBox *combo_box) void gtk_combo_box_popdown (GtkComboBox *combo_box) { - GtkComboBoxPrivate *priv = combo_box->priv; + GtkComboBoxPrivate *priv; g_return_if_fail (GTK_IS_COMBO_BOX (combo_box)); + priv = combo_box->priv; + if (GTK_IS_MENU (priv->popup_widget)) { gtk_menu_popdown (GTK_MENU (priv->popup_widget)); @@ -3964,7 +3968,7 @@ gtk_combo_box_set_model (GtkComboBox *combo_box, priv = combo_box->priv; - if (model == combo_box->priv->model) + if (model == priv->model) return; gtk_combo_box_unset_model (combo_box); @@ -4855,11 +4859,12 @@ void gtk_combo_box_set_entry_text_column (GtkComboBox *combo_box, gint text_column) { - GtkComboBoxPrivate *priv = combo_box->priv; + GtkComboBoxPrivate *priv; GtkTreeModel *model; g_return_if_fail (GTK_IS_COMBO_BOX (combo_box)); + priv = combo_box->priv; model = gtk_combo_box_get_model (combo_box); g_return_if_fail (text_column >= 0);