X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fhb-transaction.c;h=5f77203fed1a988218a6945bb1dd5ca272b78562;hb=88ee1e67be75d5618016c6f0685c91e38966774e;hp=8ab4306a937e3fc013d92e0c6f6306416091fa7e;hpb=2ef3e601408ebaeeaf5f40d6967664b012a49979;p=chaz%2Fhomebank diff --git a/src/hb-transaction.c b/src/hb-transaction.c index 8ab4306..5f77203 100644 --- a/src/hb-transaction.c +++ b/src/hb-transaction.c @@ -23,6 +23,9 @@ #include "hb-tag.h" #include "hb-split.h" +#include "ext.h" +#include "refcount.h" + /****************************************************************************/ /* Debug macros */ /****************************************************************************/ @@ -79,10 +82,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); } } @@ -90,7 +93,7 @@ da_transaction_free(Transaction *item) Transaction * da_transaction_malloc(void) { - return g_malloc0(sizeof(Transaction)); + return rc_alloc(sizeof(Transaction)); } @@ -140,7 +143,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)); DB( g_print("da_transaction_clone\n") ); @@ -466,6 +469,9 @@ gchar swap; account_balances_add (child); + GValue txn_value = G_VALUE_INIT; + ext_hook("transaction_inserted", EXT_TRANSACTION(&txn_value, child), NULL); + } } @@ -844,6 +850,9 @@ Account *acc; { transaction_xfer_search_or_add_child(NULL, newope, FALSE); } + + GValue txn_value = G_VALUE_INIT; + ext_hook("transaction_inserted", EXT_TRANSACTION(&txn_value, newope), NULL); } }