summaryrefslogtreecommitdiff
path: root/gtk/gtkmenutracker.c
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2013-06-24 17:59:02 -0400
committerRyan Lortie <desrt@desrt.ca>2013-06-24 18:05:27 -0400
commitd498e9b588fd59aabc82eea8e87962435b0fe191 (patch)
treeb9c27671a34a0bfaae5a7484410af412edcde8e6 /gtk/gtkmenutracker.c
parent708dd8cc52358f13438c9fb53051f3c717dfef50 (diff)
downloadgtk+-d498e9b588fd59aabc82eea8e87962435b0fe191.tar.gz
GtkMenuTracker: fix leak when creating submenus
Diffstat (limited to 'gtk/gtkmenutracker.c')
-rw-r--r--gtk/gtkmenutracker.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/gtk/gtkmenutracker.c b/gtk/gtkmenutracker.c
index ab369ab02f..c9e8459cc8 100644
--- a/gtk/gtkmenutracker.c
+++ b/gtk/gtkmenutracker.c
@@ -473,11 +473,20 @@ gtk_menu_tracker_new_for_item_submenu (GtkMenuTrackerItem *item,
GtkMenuTrackerRemoveFunc remove_func,
gpointer user_data)
{
- return gtk_menu_tracker_new (_gtk_menu_tracker_item_get_observable (item),
- _gtk_menu_tracker_item_get_submenu (item),
- TRUE,
- _gtk_menu_tracker_item_get_submenu_namespace (item),
- insert_func, remove_func, user_data);
+ GtkMenuTracker *tracker;
+ GMenuModel *submenu;
+ gchar *namespace;
+
+ submenu = _gtk_menu_tracker_item_get_submenu (item);
+ namespace = _gtk_menu_tracker_item_get_submenu_namespace (item);
+
+ tracker = gtk_menu_tracker_new (_gtk_menu_tracker_item_get_observable (item), submenu,
+ TRUE, namespace, insert_func, remove_func, user_data);
+
+ g_object_unref (submenu);
+ g_free (namespace);
+
+ return tracker;
}
/*< private >