[gtk: 1/2] gtk: Hold reference on controller until events are fully handled
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk: 1/2] gtk: Hold reference on controller until events are fully handled
- Date: Wed, 27 Oct 2021 23:50:14 +0000 (UTC)
commit af2d0f188c15a120935c35ecbea5d032aeaa2971
Author: Maxim Zakharov <zakhma muli com au>
Date: Wed Oct 27 11:37:36 2021 +1100
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.
gtk/gtkeventcontroller.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/gtkeventcontroller.c b/gtk/gtkeventcontroller.c
index 6892562901..2d0de55383 100644
--- a/gtk/gtkeventcontroller.c
+++ b/gtk/gtkeventcontroller.c
@@ -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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]