diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-04-29 10:18:22 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-04-29 10:18:22 -0400 |
commit | effc7514e79c5be31328f18a74b8d97a9ed20a4d (patch) | |
tree | 02a822fb12bb744c95d5b908b85cd5f12814628e /gtk/gtkmenusectionbox.c | |
parent | f248b21b1bc6e7955544f219eed9abd779984d63 (diff) | |
download | gtk+-effc7514e79c5be31328f18a74b8d97a9ed20a4d.tar.gz |
GtkMenuSectionBox: don't leak
This wasn't fully fleshed out yet.
Diffstat (limited to 'gtk/gtkmenusectionbox.c')
-rw-r--r-- | gtk/gtkmenusectionbox.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gtk/gtkmenusectionbox.c b/gtk/gtkmenusectionbox.c index 76640f9cbf..8891f59d87 100644 --- a/gtk/gtkmenusectionbox.c +++ b/gtk/gtkmenusectionbox.c @@ -293,6 +293,24 @@ gtk_menu_section_box_dispose (GObject *object) box->separator_sync_idle = 0; } + if (box->separator) + { + gtk_widget_destroy (box->separator); + box->separator = NULL; + } + + if (box->size_group) + { + g_object_unref (box->size_group); + box->size_group = NULL; + } + + if (box->tracker) + { + gtk_menu_tracker_free (box->tracker); + box->tracker = NULL; + } + G_OBJECT_CLASS (gtk_menu_section_box_parent_class)->dispose (object); } @@ -416,6 +434,8 @@ gtk_menu_section_box_new_section (GtkMenuTrackerItem *item, gtk_widget_show (box->separator); } + g_object_add_weak_pointer (G_OBJECT (box->separator), (gpointer *)&(box->separator)); + box->tracker = gtk_menu_tracker_new_for_item_link (item, G_MENU_LINK_SECTION, FALSE, gtk_menu_section_box_insert_func, gtk_menu_section_box_remove_func, |