GNOME Bugzilla – Bug 308291
[PATCH] Leak in egg-recent-view-gtk
Last modified: 2005-12-22 11:19:44 UTC
Valgrind record: ==1542== 25088 bytes in 17 blocks are still reachable in loss record 177 of 186 ==1542== at 0x3414723C: malloc (vg_replace_malloc.c:131) ==1542== by 0x7E79373: g_try_malloc (in /usr/lib/libglib-2.0.so.0.600.3) ==1542== by 0x97B7E3: gdk_pixbuf_new (in /usr/lib/libgdk_pixbuf-2.0.so.0.600.7) ==1542== by 0x98122F: gdk_pixbuf_loader_close (in /usr/lib/libgdk_pixbuf-2.0.so.0.600.7) ==1542== by 0x97ED17: gdk_pixbuf_new_from_file_at_scale (in /usr/lib/libgdk_pixbuf-2.0.so.0.600.7) ==1542== by 0x97EE9E: gdk_pixbuf_new_from_file_at_size (in /usr/lib/libgdk_pixbuf-2.0.so.0.600.7) ==1542== by 0x807901C: load_icon_file (egg-recent-util.c:68) Patch: Index: cut-n-paste/recent-files/egg-recent-view-gtk.c =================================================================== RCS file: /cvs/gnome/evince/cut-n-paste/recent-files/egg-recent-view-gtk.c,v retrieving revision 1.4 diff -u -p -r1.4 egg-recent-view-gtk.c --- cut-n-paste/recent-files/egg-recent-view-gtk.c 18 Jun 2005 10:32:47 -00+++ cut-n-paste/recent-files/egg-recent-view-gtk.c 19 Jun 2005 12:30:29 -00@@ -523,6 +523,8 @@ egg_recent_view_gtk_finalize (GObject *o g_object_unref (view->client); g_object_unref (view->tooltips); + + egg_recent_view_gtk_clear (view); } static void
Thanks for sending in. Raising priority to make maintainers aware of patch. Adding PATCH keyword.
committed, thanks
Sorry, Emmanuele, but it seems that you should revert this patch. The problem is that clear_view_gtk method refers to childred of container. In finalize, this behaviour is invalid. You should do earlier, when childrens are not destroed yet. Otherwise you'll probably get a segfault.
I've tried it before commit, in combination with other patches, and it did not segfault (the children are removed and disposed only if found, so it ends up doing nothing if the children have already been destroyed), so the worst thing that should happen is that the leak is still there. Fact is, the disposal of our children should be done in a ::destroy function, but since EggRecentViewGtk is not a GtkWidget subclass, we do not have it. I've placed the call to _view_gtk_clear right after the signal disconnect inside _view_gtk_finalize, and checked that it doesn't segfault. I don't have valgrind installed on this machine, could you please check if there's still a leak?
valgrind doesn't report this leak anymore, so I'm closing this one.