changeset 3147:6a7ce3fceff6

Updated #273: Added clean up code for separators in subStyleReset
author unexist
date Sun, 11 Dec 2011 16:53:05 +0100
parents 1e84040729c8
children 5fb6ddbed9d0
files src/subtle/style.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtle/style.c	Mon Nov 28 20:28:17 2011 +0100
+++ b/src/subtle/style.c	Sun Dec 11 16:53:05 2011 +0100
@@ -186,6 +186,15 @@
 
   s->font = NULL;
 
+  /* Reset separator */
+  if(s->flags & SUB_STYLE_SEPARATOR && s->separator)
+    {
+      free(s->separator->string);
+      free(s->separator);
+    }
+
+  s->separator = NULL;
+
   /* Remove states */
   if(s->styles) subArrayKill(s->styles, True);
   s->styles = NULL;
@@ -243,7 +252,7 @@
   if(s->flags & SUB_STYLE_SEPARATOR && s->separator)
     {
       free(s->separator->string);
-      free(s);
+      free(s->separator);
     }
 
   if(s->name)   free(s->name);