X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fhb-tag.c;h=42412c944b9a248f4bd9b08949959f8f9e9acbf3;hb=613fd4014fa5814bf2adce50574d520df8927ce1;hp=8554cfa3ad747d884431f24675b585c9bd0af383;hpb=27f6e3b112df235c8e9afc9911b1f6bce208a001;p=chaz%2Fhomebank diff --git a/src/hb-tag.c b/src/hb-tag.c index 8554cfa..42412c9 100644 --- a/src/hb-tag.c +++ b/src/hb-tag.c @@ -1,5 +1,5 @@ /* HomeBank -- Free, easy, personal accounting for everyone. - * Copyright (C) 1995-2014 Maxime DOYEN + * Copyright (C) 1995-2016 Maxime DOYEN * * This file is part of HomeBank. * @@ -20,6 +20,9 @@ #include "homebank.h" #include "hb-tag.h" +#include "ext.h" +#include "refcount.h" + #define MYDEBUG 0 #if MYDEBUG @@ -37,12 +40,12 @@ extern struct HomeBank *GLOBALS; void da_tag_free(Tag *item) { DB( g_print("da_tag_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); + rc_free(item); } } @@ -50,7 +53,7 @@ void da_tag_free(Tag *item) Tag *da_tag_malloc(void) { DB( g_print("da_tag_malloc\n") ); - return g_malloc0(sizeof(Tag)); + return rc_alloc(sizeof(Tag)); } @@ -97,9 +100,9 @@ guint da_tag_length(void) /** * da_tag_remove: * - * remove an tag from the GHashTable + * delete an tag from the GHashTable * - * Return value: TRUE if the key was found and removed + * Return value: TRUE if the key was found and deleted * */ gboolean da_tag_remove(guint32 key)