mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
perform some memory management for the pricedb stored in the book
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8522 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
d0d53c0699
commit
9e4383a29b
@ -700,9 +700,17 @@ gnc_pricedb_get_db(GNCBook *book)
|
||||
void
|
||||
gnc_pricedb_set_db(GNCBook *book, GNCPriceDB *db)
|
||||
{
|
||||
GNCPriceDB *old_db;
|
||||
|
||||
if(!book) return;
|
||||
|
||||
old_db = gnc_pricedb_get_db (book);
|
||||
if (db == old_db) return;
|
||||
|
||||
gnc_book_set_data (book, GNC_PRICEDB, db);
|
||||
if (db) db->book = book;
|
||||
|
||||
gnc_pricedb_destroy (old_db);
|
||||
}
|
||||
|
||||
/* ==================================================================== */
|
||||
|
Loading…
Reference in New Issue
Block a user