diff options
-rw-r--r-- | src/gmenuutils.c | 10 | ||||
-rw-r--r-- | src/messages-service.c | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/gmenuutils.c b/src/gmenuutils.c index f3ceba7..f63615b 100644 --- a/src/gmenuutils.c +++ b/src/gmenuutils.c @@ -40,7 +40,15 @@ g_menu_find_section (GMenu *menu, n_items = g_menu_model_get_n_items (model); for (i = 0; i < n_items; i++) { - if (section == g_menu_model_get_item_link (model, i, G_MENU_LINK_SECTION)) + GMenuModel *link; + gboolean found; + + link = g_menu_model_get_item_link (model, i, G_MENU_LINK_SECTION); + found = section == link; + + g_object_unref (link); + + if (found) return i; } diff --git a/src/messages-service.c b/src/messages-service.c index db7a8d7..31d2a5b 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -134,6 +134,8 @@ uses_chat_status_changed (GObject *object, if (show_chat) g_menu_insert_section (menu, 0, NULL, chat_section); } + + g_object_unref (first_section); } static AppSection * |