]> Dogcows Code - chaz/homebank/blobdiff - src/hb-archive.c
import homebank-5.2.7
[chaz/homebank] / src / hb-archive.c
index 890cd7f5c15bae7fb397a3f4884b68bcbfef3433..cbb732883fd598b6d53f70e06dd497dc69a80a7a 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(item != NULL)
+       {
+               da_archive_clean(item);
+               g_free(item);
+       }
+}
+
+
 Archive *da_archive_malloc(void)
 {
 Archive *item;
@@ -69,19 +113,6 @@ Archive *new_item = g_memdup(src_item, sizeof(Archive));
 }
 
 
-void da_archive_free(Archive *item)
-{
-       if(item != NULL)
-       {
-               if(item->memo != NULL)
-                       g_free(item->memo);
-               if(item->splits != NULL)
-                       da_split_destroy(item->splits);
-               g_free(item);
-       }
-}
-
-
 void da_archive_destroy(GList *list)
 {
 GList *tmplist = g_list_first(list);
This page took 0.01863 seconds and 4 git commands to generate.