GNOME Bugzilla – Bug 599793
Fix a variety of leaks
Last modified: 2009-11-02 18:06:07 UTC
I ran anjal under valgrind and discovered several leaks. Some are quite minor, and some are larger. The following patches fix several of them.
Created attachment 146347 [details] [review] Fix leak in check_and_set_default_mail() Unref the gconf client before the early return if anjal is already set as the default mailer
Created attachment 146348 [details] [review] Fix a couple major pixbuf leaks According to valgrind, in my basic run, these leaks added up to about 640k of definitely lost memory
Created attachment 146349 [details] [review] Fix leak in CustomCellRendererVBox Children were not freed: ==24387== 14,512 (48 direct, 14,464 indirect) bytes in 2 blocks are definitely lost in loss record 13,186 of 13,267 ==24387== at 0x4C221A7: malloc (vg_replace_malloc.c:195) ==24387== by 0xE747552: g_malloc (gmem.c:131) ==24387== by 0xE75D3C7: g_slice_alloc (gslice.c:824) ==24387== by 0xE73CFD5: g_list_append (glist.c:122) ==24387== by 0x427F89: custom_cell_renderer_vbox_append (custom-cell-renderer-vbox.c:269) ==24387== by 0x42539A: mail_folder_view_construct (mail-folder-view.c:1649) ==24387== by 0x425B67: mail_folder_view_new (mail-folder-view.c:1831) ==24387== by 0x41F539: mail_view_add_folder (mail-view.c:340) ==24387== by 0x42011B: mail_view_add_page (mail-view.c:531) ==24387== by 0x42027A: mv_switch_folder_view (mail-view.c:580) ==24387== by 0x4203A7: mail_view_set_folder_uri (mail-view.c:606) ==24387== by 0x41B531: folder_selected_cb (mail-component.c:405)
Created attachment 146350 [details] [review] Fix leak in emts_sort_view() nodes ptr array was not freed properly: ==25554== 6,736 (128 direct, 6,608 indirect) bytes in 4 blocks are definitely lost in loss record 13,126 of 13,261 ==25554== at 0x4C221A7: malloc (vg_replace_malloc.c:195) ==25554== by 0xE747552: g_malloc (gmem.c:131) ==25554== by 0xE75D3C7: g_slice_alloc (gslice.c:824) ==25554== by 0xE71A279: g_ptr_array_sized_new (garray.c:449) ==25554== by 0x42A9D5: emts_sort_view (em-tree-store.c:964) ==25554== by 0x42B393: em_tree_store_add_folder (em-tree-store.c:1188)
Created attachment 146351 [details] [review] Fix leak of cell renderers in MailFolderView valgrind log: ==28114== 7,728 (288 direct, 7,440 indirect) bytes in 3 blocks are definitely lost in loss record 13,093 of 13,221 ==28114== at 0x4C221A7: malloc (vg_replace_malloc.c:195) ==28114== by 0xE747552: g_malloc (gmem.c:131) ==28114== by 0xE75D3C7: g_slice_alloc (gslice.c:824) ==28114== by 0xE75D6F5: g_slice_alloc0 (gslice.c:833) ==28114== by 0xE2E962F: g_type_create_instance (gtype.c:1654) ==28114== by 0xE2CE74A: g_object_constructor (gobject.c:1338) ==28114== by 0xE2CEDBC: g_object_newv (gobject.c:1215) ==28114== by 0xE2CF906: g_object_new_valist (gobject.c:1278) ==28114== by 0xE2CFA4B: g_object_new (gobject.c:1060) ==28114== by 0x428AC8: custom_cell_renderer_toggle_pixbuf_new (custom-cell-renderer-toggle-pixbuf.c:201) ==28114== by 0x425326: mail_folder_view_construct (mail-folder-view.c:1635) ==28114== by 0x425BEB: mail_folder_view_new (mail-folder-view.c:1831) ==28114== by 0x41F5BD: mail_view_add_folder (mail-view.c:340) ==28114== by 0x42019F: mail_view_add_page (mail-view.c:531) ==28114== by 0x4202FE: mv_switch_folder_view (mail-view.c:580) ==28114== by 0x42042B: mail_view_set_folder_uri (mail-view.c:606) ==28114== by 0x41B5B5: folder_selected_cb (mail-component.c:405)
Review of attachment 146347 [details] [review]: Please commit to anjal-0-1 branch and master.
Review of attachment 146348 [details] [review]: Please commit to anjal-0-1 branch and master.
Review of attachment 146349 [details] [review]: Please commit to anjal-0-1 branch and master.
Review of attachment 146350 [details] [review]: Please commit to anjal-0-1 branch and master.
Review of attachment 146351 [details] [review]: Please commit to anjal-0-1 branch and master.
Jonathon, thanks a lot for the patches. Sorry to keep it waiting, Just got a work machine yesterday, and catching up with the work now.
Thanks, merged branch with master and cherry-picked to anjal-0-1