Re: [dev] [dwm] drw_scm_free() and drw_clr_free() in drw.h

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sat, 27 Sep 2025 12:16:04 +0200

On Fri, Sep 26, 2025 at 10:15:30PM +0000, Listeria monocytogenes wrote:
> The Xft(3) man page says:
>
> > XftColorAllocName() and XftColorAllocValue() request a color allocation
> > from the X server (if necessary) and initialize the members of XftColor.
> > XftColorFree() instructs the X server to free the color currently allo‐
> > cated for an XftColor.
>
> drw_scm_create() calls drw_clr_create() which in turn calls
> XftColorAllocName(), but instructs the user to call free(3) on the
> returned color scheme, which is insufficient, as the color allocated by
> XftColorAllocName() was not free'd.
>
> I suggest adding the functions drw_clr_free(Drw *drw, Clr *clr) and
> drw_scm_free(Drw *drw, Clr *scm, size_t clrcount) to properly free the
> allocated color and scheme.
>

Hi,

Thanks for the feedback.

I've pushed patches to dwm and dmenu.

Please test them.

-- 
Kind regards,
Hiltjo
Received on Sat Sep 27 2025 - 12:16:04 CEST

This archive was generated by hypermail 2.3.0 : Sat Sep 27 2025 - 12:24:10 CEST