]> Dogcows Code - chaz/homebank/blobdiff - src/hb-archive.c
Merge branch 'master' into ext-perl
[chaz/homebank] / src / hb-archive.c
index 1f6521411e88407ad3a04c57184caefca8ea31f4..7c4264fbb4289868badd8a52824187518f59803d 100644 (file)
 extern struct HomeBank *GLOBALS;
 
 
+/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
+
+
+static void
+da_archive_clean(Archive *item)
+{
+       if(item != NULL)
+       {
+               if(item->memo != NULL)
+               {
+                       g_free(item->memo);
+                       item->memo = NULL;
+               }
+
+
+
+
+
+               //5.3 added as it was a leak
+               if(item->tags != NULL)
+               {
+                       g_free(item->tags);
+                       item->tags = NULL;
+               }
+               if(item->splits != NULL)
+               {
+                       da_split_destroy(item->splits);
+                       item->splits = NULL;
+                       item->flags &= ~(OF_SPLIT); //Flag that Splits are cleared
+               }
+       }
+}
+
+
+void da_archive_free(Archive *item)
+{
+       if(rc_unref(item))
+       {
+               da_archive_clean(item);
+               rc_free(item);
+       }
+}
+
+
 Archive *da_archive_malloc(void)
 {
 Archive *item;
@@ -72,19 +116,6 @@ Archive *new_item = rc_dup(src_item, sizeof(Archive));
 }
 
 
-void da_archive_free(Archive *item)
-{
-       if(rc_unref(item))
-       {
-               if(item->memo != NULL)
-                       g_free(item->memo);
-               if(item->splits != NULL)
-                       da_split_destroy(item->splits);
-               rc_free(item);
-       }
-}
-
-
 void da_archive_destroy(GList *list)
 {
 GList *tmplist = g_list_first(list);
This page took 0.021927 seconds and 4 git commands to generate.