summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAugusto Castelo <alpheratz99@protonmail.com>2023-01-09 15:07:48 +0000
committerRafael Marçalo <raroma09@gmail.com>2023-01-17 20:18:26 +0000
commitd8fe22064af77e06d8d48563acff935b1693534c (patch)
tree043458cc34a5c4870aad5f9ce2474f7bd829cbf8
parentd4dbd4765824e45676e33f20ffccb47cd88ddb8f (diff)
free XImage before creating a new one
ffprepare was allocating a new XImage but wasn't freeing the previously allocated one
-rw-r--r--sent.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sent.c b/sent.c
index a52b315..87e2a2d 100644
--- a/sent.c
+++ b/sent.c
@@ -277,6 +277,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");