From 392cd816a34ff034c765425d08d65de2f27980a9 Mon Sep 17 00:00:00 2001 From: David Hampton Date: Fri, 6 Apr 2007 00:19:08 +0000 Subject: [PATCH] Balance ENTER/LEAVE calls on some functions. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15829 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/Scrub.c | 7 ++++++- src/engine/Transaction.c | 6 +++++- src/engine/gnc-lot.c | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/engine/Scrub.c b/src/engine/Scrub.c index 3ae037df49..cdd1fcc076 100644 --- a/src/engine/Scrub.c +++ b/src/engine/Scrub.c @@ -173,7 +173,10 @@ xaccSplitScrub (Split *split) ENTER ("(split=%p)", split); trans = xaccSplitGetParent (split); - if (!trans) return; + if (!trans) { + LEAVE("no trans"); + return; + } account = xaccSplitGetAccount (split); @@ -193,6 +196,7 @@ xaccSplitScrub (Split *split) if (!account) { PINFO ("Free Floating Transaction!"); + LEAVE ("no account"); return; } @@ -232,6 +236,7 @@ xaccSplitScrub (Split *split) if (gnc_numeric_same (amount, value, scu, GNC_HOW_RND_ROUND)) { + LEAVE("(split=%p) different values", split); return; } diff --git a/src/engine/Transaction.c b/src/engine/Transaction.c index 286e88708a..24d46d71e5 100644 --- a/src/engine/Transaction.c +++ b/src/engine/Transaction.c @@ -990,8 +990,12 @@ void xaccTransCommitEdit (Transaction *trans) { if (!trans) return; + ENTER ("(trans=%p)", trans); - if (!qof_commit_edit (QOF_INSTANCE(trans))) return; + if (!qof_commit_edit (QOF_INSTANCE(trans))) { + LEAVE("editlevel non-zero"); + return; + } /* We increment this for the duration of the call * so other functions don't result in a recursive diff --git a/src/engine/gnc-lot.c b/src/engine/gnc-lot.c index 30e1da5a8e..d8f916266f 100644 --- a/src/engine/gnc-lot.c +++ b/src/engine/gnc-lot.c @@ -321,11 +321,13 @@ gnc_lot_add_split (GNCLot *lot, Split *split) "\tlot account=\'%s\', split account=\'%s\'\n", xaccAccountGetName(lot->account), xaccAccountGetName (acc)); gnc_lot_commit_edit(lot); + LEAVE("different accounts"); return; } if (lot == split->lot) { gnc_lot_commit_edit(lot); + LEAVE("already in lot"); return; /* handle not-uncommon no-op */ } if (split->lot) @@ -341,6 +343,7 @@ gnc_lot_add_split (GNCLot *lot, Split *split) gnc_lot_commit_edit(lot); qof_event_gen (&lot->inst.entity, QOF_EVENT_MODIFY, NULL); + LEAVE("added to lot"); } void