[gtk/shortcuts-rebased-again: 110/145] shortcutcontroller: Unref shortcut proper
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/shortcuts-rebased-again: 110/145] shortcutcontroller: Unref shortcut proper
- Date: Sun, 23 Jun 2019 04:17:24 +0000 (UTC)
commit df37764e5378b899b0afab8c8725229048026d1e
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon May 13 22:43:51 2019 -0300
shortcutcontroller: Unref shortcut proper
g_list_model_get_item() is transfer full, so we need to
unref everything that is acquired through it.
gtk/gtkshortcutcontroller.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkshortcutcontroller.c b/gtk/gtkshortcutcontroller.c
index 17147ba113..31fbac549b 100644
--- a/gtk/gtkshortcutcontroller.c
+++ b/gtk/gtkshortcutcontroller.c
@@ -275,8 +275,12 @@ gtk_shortcut_controller_run_controllers (GtkEventController *controller,
for (i = 0; i < g_list_model_get_n_items (self->shortcuts); i++)
{
- if (gtk_shortcut_controller_trigger_shortcut (self,
- g_list_model_get_item (self->shortcuts, i),
+ GtkShortcut *shortcut = g_list_model_get_item (self->shortcuts, i);
+
+ g_object_unref (shortcut);
+
+ if (gtk_shortcut_controller_trigger_shortcut (self,
+ shortcut,
i,
event,
enable_mnemonics))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]