On Thu 19 Jun 2014 at 12:22:06 +0200, Rhialto wrote: > And, after sleeping on it, I changed my mind about not needing to > XFreePixmap() the icons from the WM_HINTS. It is needed after all.
I looked at the current twm source in NetBSD, and at first sight it appears to have the same problem with leaking Pixmaps from icons in WM_HINTS. At least, when destroying a window, it doesn't XFreePixmap() anything. But when looking a bit closer, there is a XFreePixmap() when creating the icon (both in CreateIconWindow() and when handling an updated WM_HINTS), so it doesn't need to do it later. It keeps a reference to the Pixmap implicitly because it is set as the background of the icon bitmap window (icon_bm_w). (That is still done in the current version) It looks like ctwm 3.1 is the first version where the XFreePixmap() is removed from CreateIconWindow(), so that's when the bug was introduced. (I didn't check if it was somewhere else, back then, but probably not) I think that maybe that change was made since it wants to refer to the Pixmap later when re-shaping icons, or maybe it was lost because the XPM handling was refactored to separate functions at that time. So the issue existed for a long time... 3.2 was dated at 1994-11-13 or earlier. -Olaf. -- ___ Olaf 'Rhialto' Seibert -- The Doctor: No, 'eureka' is Greek for \X/ rhialto/at/xs4all.nl -- 'this bath is too hot.'
pgpHFyA6Yf18m.pgp
Description: PGP signature
