summaryrefslogtreecommitdiff
path: root/gtk/gtkeventcontroller.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-03-02 20:16:25 -0500
committerMatthias Clasen <mclasen@redhat.com>2015-03-02 20:18:15 -0500
commit3569d373a21ddc851e7699c184951985321fecfb (patch)
tree28d1e787c4a4f91b92498f5c4587e2438586cb9c /gtk/gtkeventcontroller.c
parent0019eb7bf9646f8b364e3cc09aa7351c59d333d7 (diff)
downloadgtk+-3569d373a21ddc851e7699c184951985321fecfb.tar.gz
Fix 7c4bf742e82d812ecc5b0c3280db86d2689eb093
The objects-finalize test constructs gestures with NULL as a widget. The recent addition of weak references was not ready for that.
Diffstat (limited to 'gtk/gtkeventcontroller.c')
-rw-r--r--gtk/gtkeventcontroller.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gtk/gtkeventcontroller.c b/gtk/gtkeventcontroller.c
index 0b932abdcb..4a3e3017bc 100644
--- a/gtk/gtkeventcontroller.c
+++ b/gtk/gtkeventcontroller.c
@@ -75,7 +75,8 @@ gtk_event_controller_set_property (GObject *object,
{
case PROP_WIDGET:
priv->widget = g_value_get_object (value);
- g_object_add_weak_pointer (G_OBJECT (priv->widget), (gpointer *) &priv->widget);
+ if (priv->widget)
+ g_object_add_weak_pointer (G_OBJECT (priv->widget), (gpointer *) &priv->widget);
break;
case PROP_PROPAGATION_PHASE:
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (object),