summaryrefslogtreecommitdiff
path: root/sent.c
diff options
context:
space:
mode:
authorAugusto Castelo <alpheratz99@protonmail.com>2023-01-09 15:07:48 +0000
committerHiltjo Posthuma <hiltjo@codemadness.org>2023-01-09 18:22:20 +0100
commitc271dfb848f2a84711c7c4b720e492f338f1327b (patch)
tree201873b5f71e3af11fc56a8c87eb475411eec786 /sent.c
parent2649e8d5334f7e37a1710c60fb740ecfe91b9f9e (diff)
downloadsent-c271dfb848f2a84711c7c4b720e492f338f1327b.tar.gz
sent-c271dfb848f2a84711c7c4b720e492f338f1327b.tar.bz2
sent-c271dfb848f2a84711c7c4b720e492f338f1327b.zip
free XImage before creating a new one
ffprepare was allocating a new XImage but wasn't freeing the previously allocated one
Diffstat (limited to 'sent.c')
-rw-r--r--sent.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sent.c b/sent.c
index 9534fca..d949d71 100644
--- a/sent.c
+++ b/sent.c
@@ -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");
Software created with 💖