summaryrefslogtreecommitdiffstats
path: root/hacks/celtic.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/celtic.c
parentUpdate gitignore (diff)
downloadxscreensaver-ae69a754244c4e475c8d2591772ca8e005071d83.tar.gz
xscreensaver-ae69a754244c4e475c8d2591772ca8e005071d83.tar.xz
xscreensaver-ae69a754244c4e475c8d2591772ca8e005071d83.zip
Update to 5.42
Diffstat (limited to 'hacks/celtic.c')
-rw-r--r--hacks/celtic.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/hacks/celtic.c b/hacks/celtic.c
index 890b398..232adb6 100644
--- a/hacks/celtic.c
+++ b/hacks/celtic.c
@@ -911,6 +911,7 @@ celtic_init (Display *d_arg, Window w_arg)
XGetWindowAttributes (st->dpy, st->window, &st->xgwa);
+ if (st->colors) free (st->colors);
assert(st->colors = (XColor *) calloc (st->ncolors,sizeof(XColor)));
if (get_boolean_resource(st->dpy, "mono", "Boolean"))
@@ -983,7 +984,8 @@ celtic_draw (Display *dpy, Window window, void *closure)
pattern_del(st->pattern);
}
st->pattern = NULL;
- graph_del(st->graph);
+ if (st->graph) graph_del(st->graph);
+ st->graph = NULL;
/* recolor each time */
st->ncolors = get_integer_resource (st->dpy, "ncolors", "Integer");
@@ -1124,6 +1126,13 @@ static void
celtic_free (Display *dpy, Window window, void *closure)
{
struct state *st = (struct state *) closure;
+ XFreeGC (dpy, st->gc);
+ XFreeGC (dpy, st->shadow_gc);
+ XFreeGC (dpy, st->gc_graph);
+ if (st->pattern) pattern_del (st->pattern);
+ st->pattern = 0;
+ if (st->graph) graph_del (st->graph);
+ if (st->eraser) eraser_free (st->eraser);
free (st);
}