X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fhb-category.c;h=84a3c401abcfb5eee4d515602d6f1e4196564712;hb=refs%2Fheads%2Fext-perl;hp=3dc34e402c382dd06e66772dd6d3714399e628b6;hpb=a6c6b0df5492c2160ed97e3a376bdb2fe7c5ebc4;p=chaz%2Fhomebank diff --git a/src/hb-category.c b/src/hb-category.c index 3dc34e4..84a3c40 100644 --- a/src/hb-category.c +++ b/src/hb-category.c @@ -20,6 +20,9 @@ #include "homebank.h" #include "hb-category.h" +#include "ext.h" +#include "refcount.h" + /****************************************************************************/ /* Debug macros */ @@ -40,7 +43,7 @@ extern struct HomeBank *GLOBALS; Category * da_cat_clone(Category *src_item) { -Category *new_item = g_memdup(src_item, sizeof(Category)); +Category *new_item = rc_dup(src_item, sizeof(Category)); DB( g_print("da_cat_clone\n") ); if(new_item) @@ -57,13 +60,13 @@ void da_cat_free(Category *item) { DB( g_print("da_cat_free\n") ); - if(item != NULL) + if(rc_unref(item)) { DB( g_print(" => %d, %s\n", item->key, item->name) ); g_free(item->name); g_free(item->fullname); - g_free(item); + rc_free(item); } } @@ -72,7 +75,7 @@ Category * da_cat_malloc(void) { DB( g_print("da_cat_malloc\n") ); - return g_malloc0(sizeof(Category)); + return rc_alloc(sizeof(Category)); }