From fb36c642ce787c2ba2c9ec076250b12dac8c0546 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 14 Mar 2015 22:42:06 -0500 Subject: fix GAction leakage found while testing new unit tests with valgrind --- src/actions.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/actions.cpp') diff --git a/src/actions.cpp b/src/actions.cpp index 41c7f11..839c9cd 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -223,18 +223,26 @@ Actions::Actions(const std::shared_ptr& state): auto v = create_default_header_state(); auto a = g_simple_action_new_stateful("desktop-header", nullptr, v); g_action_map_add_action(gam, G_ACTION(a)); + g_object_unref(a); + a = g_simple_action_new_stateful("desktop_greeter-header", nullptr, v); g_action_map_add_action(gam, G_ACTION(a)); + g_object_unref(a); + a = g_simple_action_new_stateful("phone-header", nullptr, v); g_action_map_add_action(gam, G_ACTION(a)); + g_object_unref(a); + a = g_simple_action_new_stateful("phone_greeter-header", nullptr, v); g_action_map_add_action(gam, G_ACTION(a)); + g_object_unref(a); // add the calendar action v = create_calendar_state(state); a = g_simple_action_new_stateful("calendar", G_VARIANT_TYPE_INT64, v); g_action_map_add_action(gam, G_ACTION(a)); g_signal_connect(a, "activate", G_CALLBACK(on_calendar_activated), this); + g_object_unref(a); /// /// Keep our GActionGroup's action's states in sync with m_state -- cgit v1.2.3