free XImage before creating a new one

ffprepare was allocating a new XImage but wasn't freeing the
previously allocated one
This commit is contained in:
Augusto Castelo 2023-01-09 15:07:48 +00:00 committed by Hiltjo Posthuma
parent 2649e8d533
commit c271dfb848

3
sent.c
View File

@ -270,6 +270,9 @@ ffprepare(Image *img)
if (depth < 24) if (depth < 24)
die("sent: Display color depths < 24 not supported"); die("sent: Display color depths < 24 not supported");
if (img->ximg)
XDestroyImage(img->ximg);
if (!(img->ximg = XCreateImage(xw.dpy, CopyFromParent, depth, ZPixmap, 0, if (!(img->ximg = XCreateImage(xw.dpy, CopyFromParent, depth, ZPixmap, 0,
NULL, width, height, 32, 0))) NULL, width, height, 32, 0)))
die("sent: Unable to create XImage"); die("sent: Unable to create XImage");