summaryrefslogtreecommitdiffstats
path: root/hacks/barcode.c
diff options
context:
space:
mode:
authorSimon Rettberg2019-02-18 11:55:58 +0100
committerSimon Rettberg2019-02-18 11:55:58 +0100
commitaa7530630e595b80d5db54655fd827b61edc0fd7 (patch)
tree048cb74072450c7592f254c3537ac8f252d09d73 /hacks/barcode.c
parentForgot one DPMS killing instance (diff)
parentUpdate to 5.42 (diff)
downloadxscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.tar.gz
xscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.tar.xz
xscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.zip
Merge branch 'master' into openslxv23
Diffstat (limited to 'hacks/barcode.c')
-rw-r--r--hacks/barcode.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/hacks/barcode.c b/hacks/barcode.c
index 31574bd..2ce609e 100644
--- a/hacks/barcode.c
+++ b/hacks/barcode.c
@@ -391,14 +391,12 @@ static void bitmapClear (Bitmap *b)
memset (b->buf, 0, b->widthBytes * b->height);
}
-#if 0
/* free a bitmap */
static void bitmapFree (Bitmap *b)
{
free (b->buf);
free (b);
}
-#endif
/* get the byte value at the given byte-offset coordinates in the given
@@ -1913,6 +1911,16 @@ barcode_reshape (Display *dpy, Window window, void *closure,
static void
barcode_free (Display *dpy, Window window, void *closure)
{
+ struct state *st = (struct state *) closure;
+ int i;
+ XFreeGC (dpy, st->theGC);
+ st->theImage->data = 0;
+ XDestroyImage (st->theImage);
+ bitmapFree (st->theBitmap);
+ for (i = 0; i < st->barcode_max; i++)
+ bitmapFree (st->barcodes[i].bitmap);
+ free (st->barcodes);
+ free (st);
}