[gtk+/gtk-3-20] combobox: If typechecking, don’t dereference before
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-20] combobox: If typechecking, don’t dereference before
- Date: Fri, 20 Jan 2017 21:53:50 +0000 (UTC)
commit 7f9ef6f9cbfaae0263654800957d6e60473501a4
Author: Daniel Boles <dboles src gnome org>
Date: Fri Jan 20 21:07:26 2017 +0000
combobox: If typechecking, don’t dereference before
gtk/gtkcombobox.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 7954bab..ed59544 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -2415,7 +2415,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;
@@ -2424,6 +2424,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;
@@ -2545,10 +2547,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));
@@ -4077,7 +4081,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);
@@ -4967,11 +4971,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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]