[gnome-todo] list-selector-panel: fix GMenu leak



commit 1a1d3d9e46bfac7241db547b388977b99bc3f96c
Author: Victor Toso <me victortoso com>
Date:   Fri Oct 28 00:13:02 2016 +0200

    list-selector-panel: fix GMenu leak
    
     761 (48 direct, 713 indirect) bytes in 1 blocks are definitely lost in loss record 16,318 of 16,889
        at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
        by 0xA5229D5: g_malloc (gmem.c:94)
        by 0xA53CB3D: g_slice_alloc (gslice.c:1025)
        by 0xA53CB7D: g_slice_alloc0 (gslice.c:1051)
        by 0xA09AC0A: g_type_create_instance (gtype.c:1848)
        by 0xA081290: g_object_new_internal (gobject.c:1783)
        by 0xA08179F: g_object_newv (gobject.c:1930)
        by 0xA080E41: g_object_new (gobject.c:1623)
        by 0x90B7FC0: g_menu_new (gmenu.c:249)
        by 0x41DF69: gtd_list_selector_panel_init (gtd-list-selector-panel.c:698)
        by 0xA09ACCD: g_type_create_instance (gtype.c:1866)
        by 0xA081290: g_object_new_internal (gobject.c:1783)
    
    Signed-off-by: Victor Toso <victortoso redhat com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773606

 src/views/gtd-list-selector-panel.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/views/gtd-list-selector-panel.c b/src/views/gtd-list-selector-panel.c
index df465b9..a552e8b 100644
--- a/src/views/gtd-list-selector-panel.c
+++ b/src/views/gtd-list-selector-panel.c
@@ -475,6 +475,16 @@ gtd_panel_iface_init (GtdPanelInterface *iface)
 }
 
 static void
+gtd_list_selector_panel_finalize (GObject *object)
+{
+  GtdListSelectorPanel *self = GTD_LIST_SELECTOR_PANEL (object);
+
+  g_clear_object (&self->menu);
+
+  G_OBJECT_CLASS (gtd_list_selector_panel_parent_class)->finalize (object);
+}
+
+static void
 gtd_list_selector_panel_get_property (GObject    *object,
                                       guint       prop_id,
                                       GValue     *value,
@@ -562,6 +572,7 @@ gtd_list_selector_panel_class_init (GtdListSelectorPanelClass *klass)
 
   object_class->get_property = gtd_list_selector_panel_get_property;
   object_class->set_property = gtd_list_selector_panel_set_property;
+  object_class->finalize = gtd_list_selector_panel_finalize;
 
   g_object_class_override_property (object_class,
                                     PROP_MENU,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]