[gnome-todo] task-list-view: don't leak GList of GtdTask



commit a4c742ab83940e337348b3f63b866c5d8167c5d0
Author: Victor Toso <me victortoso com>
Date:   Thu Sep 29 23:24:09 2016 +0200

    task-list-view: don't leak GList of GtdTask
    
    48 (24 direct, 24 indirect) bytes in 1 blocks are definitely lost in loss record 9,485 of 17,147
       at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
       by 0xA1F890E: g_malloc (gmem.c:94)
       by 0xA212A55: g_slice_alloc (gslice.c:1025)
       by 0xA1EC8DA: g_list_copy_deep (glist.c:678)
       by 0xA1EC8A7: g_list_copy (glist.c:633)
       by 0x426036: gtd_task_list_view_set_list (gtd-task-list-view.c:968)
       by 0x4264A5: gtd_task_list_view_set_task_list (gtd-task-list-view.c:1118)
       by 0x41B5E4: gtd_list_selector_panel_list_selected (gtd-list-selector-panel.c:250)
       by 0x9D544E7: g_cclosure_marshal_VOID__OBJECT (gmarshal.c:2062)
       by 0x9D4F8B9: g_closure_invoke (gclosure.c:804)
       by 0x9D6BD25: signal_emit_unlocked_R (gsignal.c:3635)
       by 0x9D6B05C: g_signal_emit_valist (gsignal.c:3391)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772212

 src/gtd-task-list-view.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/gtd-task-list-view.c b/src/gtd-task-list-view.c
index a21bfce..ee49e15 100644
--- a/src/gtd-task-list-view.c
+++ b/src/gtd-task-list-view.c
@@ -707,6 +707,9 @@ gtd_task_list_view__create_task (GtdTaskRow *row,
 static void
 gtd_task_list_view_finalize (GObject *object)
 {
+  GtdTaskListViewPrivate *priv = GTD_TASK_LIST_VIEW (object)->priv;
+
+  g_clear_pointer (&priv->list, g_list_free);
   G_OBJECT_CLASS (gtd_task_list_view_parent_class)->finalize (object);
 }
 


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