mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-15 14:50:06 +00:00
gtk: Hold reference on controller until events are fully handled
Fixes premature controller unreferencing in gtk_event_controller_handle_event() if the controller itself is being removed while handling the event.
This commit is contained in:
parent
4ea84d3144
commit
af2d0f188c
@ -367,10 +367,10 @@ gtk_event_controller_handle_event (GtkEventController *controller,
|
||||
|
||||
g_object_ref (controller);
|
||||
retval = controller_class->handle_event (controller, event, x, y);
|
||||
g_object_unref (controller);
|
||||
|
||||
g_clear_object (&priv->target);
|
||||
g_clear_pointer (&priv->event, gdk_event_unref);
|
||||
g_object_unref (controller);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user