diff options
author | Simon Rettberg | 2019-02-18 11:55:58 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-02-18 11:55:58 +0100 |
commit | aa7530630e595b80d5db54655fd827b61edc0fd7 (patch) | |
tree | 048cb74072450c7592f254c3537ac8f252d09d73 /hacks/lmorph.c | |
parent | Forgot one DPMS killing instance (diff) | |
parent | Update to 5.42 (diff) | |
download | xscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.tar.gz xscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.tar.xz xscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.zip |
Merge branch 'master' into openslxv23
Diffstat (limited to 'hacks/lmorph.c')
-rw-r--r-- | hacks/lmorph.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/hacks/lmorph.c b/hacks/lmorph.c index 9468a72..ae45da1 100644 --- a/hacks/lmorph.c +++ b/hacks/lmorph.c @@ -362,6 +362,7 @@ initLMorph(struct state *st) fprintf(stderr, "figtype should be `all', `open' or `closed'.\n"); st->figType = FT_ALL; } + if (ft) free (ft); if (steps <= 0) steps = (random() % 400) + 100; @@ -389,7 +390,7 @@ initLMorph(struct state *st) st->aSlopeTo = (XPoint *) xmalloc(st->numPoints * sizeof(XPoint)); st->aSlopeFrom = (XPoint *) xmalloc(st->numPoints * sizeof(XPoint)); - st->aNext = (XPoint *) xmalloc(st->numPoints * sizeof(XPoint)); + st->aNext = 0; for (i = 0; i < st->numPoints ; i++) { st->aSlopeTo[i].x = 0.0; @@ -562,6 +563,16 @@ static void lmorph_free (Display *dpy, Window window, void *closure) { struct state *st = (struct state *) closure; + int i; + XFreeGC (dpy, st->gcDraw); + XFreeGC (dpy, st->gcClear); + free (st->aWork[0]); + free (st->aWork[1]); + free (st->aTmp); + free (st->aSlopeTo); + free (st->aSlopeFrom); + for (i = 0; i < MAXFIGS; i++) + if (st->a[i]) free (st->a[i]); free (st); } |