[glib] Don't leak references in the actions example
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Don't leak references in the actions example
- Date: Mon, 1 Nov 2010 00:50:46 +0000 (UTC)
commit cb8d29a55897b65c5d60077db19f39d1c01b2f86
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Oct 31 20:33:02 2010 -0400
Don't leak references in the actions example
These are not initially unowned...
gio/tests/gapplication-example-actions.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gio/tests/gapplication-example-actions.c b/gio/tests/gapplication-example-actions.c
index bca0b06..4bb7fc6 100644
--- a/gio/tests/gapplication-example-actions.c
+++ b/gio/tests/gapplication-example-actions.c
@@ -53,13 +53,16 @@ add_actions (GApplication *app)
action = g_simple_action_new ("simple-action", NULL);
g_signal_connect (action, "activate", G_CALLBACK (activate_action), app);
g_simple_action_group_insert (actions, G_ACTION (action));
+ g_object_unref (action);
action = g_simple_action_new_stateful ("toggle-action", NULL,
g_variant_new_boolean (FALSE));
g_signal_connect (action, "activate", G_CALLBACK (activate_toggle_action), app);
g_simple_action_group_insert (actions, G_ACTION (action));
+ g_object_unref (action);
g_application_set_action_group (app, G_ACTION_GROUP (actions));
+ g_object_unref (actions);
}
int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]