gnucash stable: Bug 799099 - Crash when trying to get quotes

John Ralls jralls at code.gnucash.org
Fri Oct 20 11:50:49 EDT 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/45925303 (commit)
	from  https://github.com/Gnucash/gnucash/commit/56699805 (commit)



commit 4592530318d21c91d234c0921c6c11819232591a
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Oct 20 08:46:57 2023 -0700

    Bug 799099 - Crash when trying to get quotes
    
    The comment on gnc_pricedb_add_price says that writing to the
    GNCPrice* after calling it will produce interesting results, and
    calling gnc_price_commit_edit and g_object_unref both qualify, so
    remove those calls and the corresponding gnc_price_begin_edit.

diff --git a/libgnucash/app-utils/gnc-quotes.cpp b/libgnucash/app-utils/gnc-quotes.cpp
index 19e846a192..d666a69b1e 100644
--- a/libgnucash/app-utils/gnc-quotes.cpp
+++ b/libgnucash/app-utils/gnc-quotes.cpp
@@ -790,10 +790,8 @@ GncQuotesImpl::create_quotes (const bpt::ptree& pt, const CommVec& comm_vec)
         auto price{parse_one_quote(pt, comm)};
         if (!price)
             continue;
-        gnc_price_begin_edit (price);
+// See the comment at gnc_pricedb_add_price
         gnc_pricedb_add_price(pricedb, price);
-        gnc_price_commit_edit(price);
-        gnc_price_unref (price);
     }
 }
 



Summary of changes:
 libgnucash/app-utils/gnc-quotes.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)



More information about the gnucash-changes mailing list