GNOME Bugzilla – Bug 168675
Desktop background holds both pixmap and pixbuf
Last modified: 2005-03-09 20:53:00 UTC
Please describe the problem: I was playing around with valgrind on nautilus and noticed: ==4407== 3932160 bytes in 1 blocks are still reachable in loss record 13246 of 13246 ==4407== at 0x3414A584: malloc (in /usr/lib/valgrind/vgpreload_addrcheck.so) ==4407== by 0x34D9581B: IA__g_try_malloc (gmem.c:194) ==4407== by 0x3488A8E5: IA__gdk_pixbuf_new (gdk-pixbuf.c:300) ==4407== by 0x34890EA1: IA__gdk_pixbuf_scale_simple (gdk-pixbuf-scale.c:252) ==4407== by 0x34250674: eel_background_pre_draw (eel-background.c:586) ==4407== by 0x34251B8E: eel_background_get_pixmap_and_color (eel-background.c:771) ==4407== by 0x34251D40: eel_background_set_up_widget (eel-background.c:1518) ==4407== by 0x34251EB6: eel_widget_background_changed (eel-background.c:1550) ==4407== by 0x34D14EBC: IA__g_cclosure_marshal_VOID__VOID (gmarshal.c:77) ==4407== by 0x34D09895: IA__g_closure_invoke (gclosure.c:437) What is interesting is that we also hold the pixmap that is used on the X server to display the image. So it looks like this 4 mb of memory is wasted. The pixbuf is allocated in `eel_background_ensure_image_scaled'. However, it is never freed (though a reference is kept). In `eel_background_ensure_realized' the background is drawn to a pixmap with: pixmap = gdk_pixmap_new (window, pixmap_width, pixmap_height, -1); gc = gdk_gc_new (pixmap); eel_background_pre_draw (background, entire_width, entire_height); eel_background_draw (background, pixmap, gc, 0, 0, 0, 0, pixmap_width, pixmap_height); g_object_unref (gc); background->details->background_pixmap = pixmap; However, we don't free the pixbuf that was used to hold the image. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
*** This bug has been marked as a duplicate of 169347 ***