X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fhb-transaction.c;fp=src%2Fhb-transaction.c;h=1d6699871a85d174156d7e893b3d8ee2fe1be5de;hb=5b7b5519d955cd0c99d094ba140514e0a2b73083;hp=3a5f6cfa7676fa649827765995f74e6c0d829a1e;hpb=8988b3bef0760b4cab8144715cc3d8f55688861c;p=chaz%2Fhomebank diff --git a/src/hb-transaction.c b/src/hb-transaction.c index 3a5f6cf..1d66998 100644 --- a/src/hb-transaction.c +++ b/src/hb-transaction.c @@ -22,6 +22,9 @@ #include "hb-transaction.h" #include "hb-tag.h" +#include "ext.h" +#include "refcount.h" + /****************************************************************************/ /* Debug macros */ /****************************************************************************/ @@ -202,10 +205,10 @@ da_transaction_clean(Transaction *item) void da_transaction_free(Transaction *item) { - if(item != NULL) + if(rc_unref(item)) { da_transaction_clean(item); - g_free(item); + rc_free(item); } } @@ -213,7 +216,7 @@ da_transaction_free(Transaction *item) Transaction * da_transaction_malloc(void) { - return g_malloc0(sizeof(Transaction)); + return rc_alloc(sizeof(Transaction)); } @@ -262,7 +265,7 @@ Transaction *da_transaction_init_from_template(Transaction *txn, Archive *arc) Transaction *da_transaction_clone(Transaction *src_item) { -Transaction *new_item = g_memdup(src_item, sizeof(Transaction)); +Transaction *new_item = rc_dup(src_item, sizeof(Transaction)); guint count; DB( g_print("da_transaction_clone\n") ); @@ -632,6 +635,9 @@ gchar swap; if(treeview != NULL) transaction_add_treeview(child, treeview, ope->kacc); + + GValue txn_value = G_VALUE_INIT; + ext_hook("transaction_inserted", EXT_TRANSACTION(&txn_value, child), NULL); } } @@ -827,6 +833,9 @@ Account *acc; { transaction_xfer_search_or_add_child(newope, treeview); } + + GValue txn_value = G_VALUE_INIT; + ext_hook("transaction_inserted", EXT_TRANSACTION(&txn_value, newope), NULL); } }