mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
a few small fixes
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8528 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
95111f1109
commit
365c12983f
@ -92,15 +92,11 @@ xaccGetAccountGroup (GNCBook *book)
|
|||||||
void
|
void
|
||||||
xaccSetAccountGroup (GNCBook *book, AccountGroup *grp)
|
xaccSetAccountGroup (GNCBook *book, AccountGroup *grp)
|
||||||
{
|
{
|
||||||
|
AccountGroup *old_grp;
|
||||||
if (!book) return;
|
if (!book) return;
|
||||||
|
|
||||||
/* XXX Do not free the old topgroup here unless you also fix
|
old_grp = xaccGetAccountGroup (grp);
|
||||||
* all the other uses of gnc_book_set_group! That's because
|
if (old_grp == grp) return;
|
||||||
* the account group is not reference-counted, and there's some
|
|
||||||
* chance that we'll leave a dangling pointer somewhere.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (gnc_book_get_group (book) == grp) return;
|
|
||||||
|
|
||||||
if (grp && grp->book != book)
|
if (grp && grp->book != book)
|
||||||
{
|
{
|
||||||
@ -109,6 +105,14 @@ xaccSetAccountGroup (GNCBook *book, AccountGroup *grp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gnc_book_set_data (book, GNC_TOP_GROUP, grp);
|
gnc_book_set_data (book, GNC_TOP_GROUP, grp);
|
||||||
|
|
||||||
|
/* XXX Do not free the old topgroup here unless you also fix
|
||||||
|
* all the other uses of xaccSetAccountGroup()! That's because
|
||||||
|
* the account group is not reference-counted, and there's some
|
||||||
|
* chance that we'll leave a dangling pointer somewhere.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* xaccAccountGroupDestroy (old_grp); */
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************************************************************\
|
/********************************************************************\
|
||||||
|
Loading…
Reference in New Issue
Block a user