summaryrefslogtreecommitdiffstats
path: root/hacks/coral.c
diff options
context:
space:
mode:
authorSimon Rettberg2019-02-18 11:55:41 +0100
committerSimon Rettberg2019-02-18 11:55:41 +0100
commitae69a754244c4e475c8d2591772ca8e005071d83 (patch)
tree58b3fa7abc2dcfe3c23e1c0ce108950c720826ab /hacks/coral.c
parentUpdate gitignore (diff)
downloadxscreensaver-ae69a754244c4e475c8d2591772ca8e005071d83.tar.gz
xscreensaver-ae69a754244c4e475c8d2591772ca8e005071d83.tar.xz
xscreensaver-ae69a754244c4e475c8d2591772ca8e005071d83.zip
Update to 5.42
Diffstat (limited to 'hacks/coral.c')
-rw-r--r--hacks/coral.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hacks/coral.c b/hacks/coral.c
index 9cfcf50..f82f9ed 100644
--- a/hacks/coral.c
+++ b/hacks/coral.c
@@ -71,8 +71,10 @@ init_coral(struct state *st)
st->ncolors = 0;
}
gcv.foreground = st->default_fg_pixel = get_pixel_resource(st->dpy, cmap, "foreground", "Foreground");
+ if (st->draw_gc) XFreeGC (st->dpy, st->draw_gc);
st->draw_gc = XCreateGC(st->dpy, st->window, GCForeground, &gcv);
gcv.foreground = get_pixel_resource (st->dpy, cmap, "background", "Background");
+ if (st->erase_gc) XFreeGC (st->dpy, st->erase_gc);
st->erase_gc = XCreateGC (st->dpy, st->window, GCForeground, &gcv);
st->ncolors = NCOLORSMAX;
make_uniform_colormap(xgwa.screen, xgwa.visual, cmap,
@@ -283,6 +285,8 @@ coral_free (Display *dpy, Window window, void *closure)
{
struct state *st = (struct state *) closure;
free (st->pointbuf);
+ XFreeGC (dpy, st->draw_gc);
+ XFreeGC (dpy, st->erase_gc);
if (st->walkers) free (st->walkers);
if (st->board) free (st->board);
free (st);