mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix bugs, mem leaks.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3529 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
3b05398c60
commit
9d6c83e66d
@ -104,7 +104,7 @@ xaccInitAccount (Account * acc)
|
||||
|
||||
xaccGUIDNew(&acc->guid);
|
||||
xaccStoreEntity(acc, &acc->guid, GNC_ID_ACCOUNT);
|
||||
LEAVE ("guid=%s\n", guid_to_string(&acc->guid));
|
||||
LEAVE ("account=%p\n", acc);
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
@ -375,7 +375,7 @@ xaccAccountSetGUID (Account *account, GUID *guid)
|
||||
{
|
||||
if (!account || !guid) return;
|
||||
|
||||
PINFO("acct=%p guid=%s", account, guid_to_string(guid));
|
||||
PINFO("acct=%p", account);
|
||||
xaccRemoveEntity(&account->guid);
|
||||
|
||||
account->guid = *guid;
|
||||
|
@ -208,8 +208,7 @@ xaccSplitScrub (Split *split)
|
||||
scu, GNC_RND_ROUND))
|
||||
return;
|
||||
|
||||
PINFO ("split with mismatched values: %s",
|
||||
guid_to_string (xaccSplitGetGUID (split)));
|
||||
PINFO ("split with mismatched values");
|
||||
|
||||
trans_was_open = xaccTransIsOpen (trans);
|
||||
|
||||
@ -304,7 +303,7 @@ xaccTransScrubImbalance (Transaction *trans, AccountGroup *root,
|
||||
/* put split into account before setting split value */
|
||||
if (!balance_split)
|
||||
{
|
||||
balance_split = xaccMallocSplit();
|
||||
balance_split = xaccMallocSplit ();
|
||||
|
||||
xaccAccountBeginEdit (account);
|
||||
xaccAccountInsertSplit (account, balance_split);
|
||||
@ -312,8 +311,7 @@ xaccTransScrubImbalance (Transaction *trans, AccountGroup *root,
|
||||
}
|
||||
}
|
||||
|
||||
PINFO ("unbalanced transaction: %s",
|
||||
guid_to_string (xaccTransGetGUID (trans)));
|
||||
PINFO ("unbalanced transaction");
|
||||
|
||||
{
|
||||
const gnc_commodity *common_currency;
|
||||
@ -364,6 +362,8 @@ xaccTransScrubImbalance (Transaction *trans, AccountGroup *root,
|
||||
if (balance_split)
|
||||
xaccTransAppendSplit (trans, balance_split);
|
||||
|
||||
xaccSplitScrub (balance_split);
|
||||
|
||||
if (!trans_was_open)
|
||||
xaccTransCommitEdit (trans);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user