summaryrefslogtreecommitdiffstats
path: root/hacks/compass.c
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/compass.c')
-rw-r--r--hacks/compass.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hacks/compass.c b/hacks/compass.c
index 1dc1d3e..1678ca9 100644
--- a/hacks/compass.c
+++ b/hacks/compass.c
@@ -957,6 +957,18 @@ compass_event (Display *dpy, Window window, void *closure, XEvent *event)
static void
compass_free (Display *dpy, Window window, void *closure)
{
+ struct state *st = (struct state *) closure;
+ int i;
+ XFreeGC (dpy, st->ptr_gc);
+ XFreeGC (dpy, st->erase_gc);
+ for (i = 0; i < 4; i++)
+ if (st->discs[i]) {
+ XFreeGC (dpy, st->discs[i]->gc);
+ free (st->discs[i]);
+ }
+ if (st->ba) XFreePixmap (dpy, st->ba);
+ if (st->bb) XFreePixmap (dpy, st->bb);
+ free (st);
}