Comment 11 for bug 263211

Roland Dreier (roland.dreier) wrote :

So I've analyzed the gnome-screensaver/gnome_bg_create_pixmap() problem a little further. I believe this is (arguably) a bug in libgnome-desktop: gnome_bg_create_pixmap() creates an X client with CloseDownMode set to RetainPermanent, and uses this client to create a new pixmap, which it then passes to gdk_pixmap_foreign_new().

However, when the ref count on this gdk pixmap drops to zero, gdk does not actually free the pixmap, because it has the is_foreign flag set (since it was created with gdk_pixmap_foreign_new()). So the dummy X client from libgnome-desktop is left with one pixmap forever. The problem is that libgnome-desktop just forgets about the pixmap it creates and passes to gdk_pixmap_foreign_new() as soon as gnome_bg_create_pixmap() returns, so it leaks.

However I'm not sure what a good fix for this is yet.