[hackers] [sent] free XImage before creating a new one || Augusto Castelo

From: <git_AT_suckless.org>
Date: Mon, 9 Jan 2023 18:20:50 +0100 (CET)

commit c271dfb848f2a84711c7c4b720e492f338f1327b
Author: Augusto Castelo <alpheratz99_AT_protonmail.com>
AuthorDate: Mon Jan 9 15:07:48 2023 +0000
Commit: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
CommitDate: Mon Jan 9 18:22:20 2023 +0100

    free XImage before creating a new one
    
    ffprepare was allocating a new XImage but wasn't freeing the
    previously allocated one

diff --git a/sent.c b/sent.c
index 9534fca..d949d71 100644
--- a/sent.c
+++ b/sent.c
_AT_@ -270,6 +270,9 @@ ffprepare(Image *img)
         if (depth < 24)
                 die("sent: Display color depths < 24 not supported");
 
+ if (img->ximg)
+ XDestroyImage(img->ximg);
+
         if (!(img->ximg = XCreateImage(xw.dpy, CopyFromParent, depth, ZPixmap, 0,
                                        NULL, width, height, 32, 0)))
                 die("sent: Unable to create XImage");
Received on Mon Jan 09 2023 - 18:20:50 CET

This archive was generated by hypermail 2.3.0 : Mon Jan 09 2023 - 18:24:32 CET