summaryrefslogtreecommitdiffstats
path: root/hacks/xrayswarm.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/xrayswarm.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/xrayswarm.c')
-rw-r--r--hacks/xrayswarm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hacks/xrayswarm.c b/hacks/xrayswarm.c
index 678c7b0..d14eb39 100644
--- a/hacks/xrayswarm.c
+++ b/hacks/xrayswarm.c
@@ -324,6 +324,7 @@ static int initGraphics(struct state *st)
color.flags=DoRed|DoGreen|DoBlue;
XAllocColor(st->dpy,cmap,&color);
xgcv.foreground=color.pixel;
+ if (st->fgc[i]) XFreeGC (st->dpy, st->fgc[i]);
st->fgc[i] = XCreateGC(st->dpy, st->win, GCForeground | GCFunction,&xgcv);
#ifdef HAVE_JWXYZ
jwxyz_XSetAntiAliasing (st->dpy, st->fgc[i], False);
@@ -1218,6 +1219,10 @@ static void
xrayswarm_free (Display *dpy, Window window, void *closure)
{
struct state *st = (struct state *) closure;
+ int i;
+ for (i = 0; i < 256; i++)
+ if (st->fgc[i]) XFreeGC (dpy, (st->fgc[i]));
+ XFreeGC (dpy, st->cgc);
free (st);
}