mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 06:21:14 +00:00
Fix 7c4bf742e8
The objects-finalize test constructs gestures with NULL as a widget. The recent addition of weak references was not ready for that.
This commit is contained in:
parent
0019eb7bf9
commit
3569d373a2
@ -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),
|
||||
|
@ -17196,8 +17196,8 @@ _gtk_widget_has_controller (GtkWidget *widget,
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_widget_add_controller (GtkWidget *widget,
|
||||
GtkEventController *controller)
|
||||
_gtk_widget_add_controller (GtkWidget *widget,
|
||||
GtkEventController *controller)
|
||||
{
|
||||
EventControllerData *data;
|
||||
GtkWidgetPrivate *priv;
|
||||
@ -17249,6 +17249,8 @@ _gtk_widget_remove_controller (GtkWidget *widget,
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
g_object_remove_weak_pointer (G_OBJECT (data->controller), (gpointer *) &data->controller);
|
||||
|
||||
if (g_signal_handler_is_connected (widget, data->grab_notify_id))
|
||||
g_signal_handler_disconnect (widget, data->grab_notify_id);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user