After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 599793 - Fix a variety of leaks
Fix a variety of leaks
Status: RESOLVED FIXED
Product: anjal
Classification: Deprecated
Component: shell
git master
Other All
: Normal normal
: ---
Assigned To: anjal-maint
anjal-maint
Depends on:
Blocks:
 
 
Reported: 2009-10-27 15:39 UTC by Jonathon Jongsma
Modified: 2009-11-02 18:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix leak in check_and_set_default_mail() (1.09 KB, patch)
2009-10-27 15:39 UTC, Jonathon Jongsma
accepted-commit_now Details | Review
Fix a couple major pixbuf leaks (2.05 KB, patch)
2009-10-27 15:39 UTC, Jonathon Jongsma
accepted-commit_now Details | Review
Fix leak in CustomCellRendererVBox (2.26 KB, patch)
2009-10-27 15:39 UTC, Jonathon Jongsma
accepted-commit_now Details | Review
Fix leak in emts_sort_view() (1.22 KB, patch)
2009-10-27 15:39 UTC, Jonathon Jongsma
accepted-commit_now Details | Review
Fix leak of cell renderers in MailFolderView (3.04 KB, patch)
2009-10-27 15:39 UTC, Jonathon Jongsma
accepted-commit_now Details | Review

Description Jonathon Jongsma 2009-10-27 15:39:29 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.
Comment 1 Jonathon Jongsma 2009-10-27 15:39:31 UTC
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
Comment 2 Jonathon Jongsma 2009-10-27 15:39:34 UTC
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
Comment 3 Jonathon Jongsma 2009-10-27 15:39:36 UTC
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)
Comment 4 Jonathon Jongsma 2009-10-27 15:39:39 UTC
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)
Comment 5 Jonathon Jongsma 2009-10-27 15:39:42 UTC
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)
Comment 6 Srinivasa Ragavan 2009-10-30 11:13:50 UTC
Review of attachment 146347 [details] [review]:

Please commit to anjal-0-1 branch and master.
Comment 7 Srinivasa Ragavan 2009-10-30 11:15:46 UTC
Review of attachment 146348 [details] [review]:

Please commit to anjal-0-1 branch and master.
Comment 8 Srinivasa Ragavan 2009-10-30 11:16:14 UTC
Review of attachment 146349 [details] [review]:

Please commit to anjal-0-1 branch and master.
Comment 9 Srinivasa Ragavan 2009-10-30 11:18:32 UTC
Review of attachment 146350 [details] [review]:

Please commit to anjal-0-1 branch and master.
Comment 10 Srinivasa Ragavan 2009-10-30 11:19:00 UTC
Review of attachment 146351 [details] [review]:

Please commit to anjal-0-1 branch and master.
Comment 11 Srinivasa Ragavan 2009-10-30 11:20:13 UTC
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.
Comment 12 Jonathon Jongsma 2009-11-02 18:06:07 UTC
Thanks, merged branch with master and cherry-picked to anjal-0-1