diff options
author | Thomas White <taw@bitwiz.me.uk> | 2019-05-02 21:28:38 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2019-05-02 21:28:38 +0200 |
commit | 417c11923591f7dd2df9bf0412aef4cee44afd74 (patch) | |
tree | e0d6bd0d03063ce05423e275d48fc8065f7f692a /libstorycode/stylesheet.c | |
parent | ea7a374be650bc5c5892d288b5869a1a2cabd78c (diff) |
Free stylesheets properly
Diffstat (limited to 'libstorycode/stylesheet.c')
-rw-r--r-- | libstorycode/stylesheet.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libstorycode/stylesheet.c b/libstorycode/stylesheet.c index c4625f2..2b549db 100644 --- a/libstorycode/stylesheet.c +++ b/libstorycode/stylesheet.c @@ -133,8 +133,20 @@ static void default_style(struct style *s) } +static void free_style_contents(struct style *sty) +{ + int i; + for ( i=0; i<sty->n_substyles; i++ ) { + free_style_contents(&sty->substyles[i]); + } + free(sty->name); + free(sty->substyles); +} + + void stylesheet_free(Stylesheet *s) { + free_style_contents(&s->top); free(s); } |