gnucash stable: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Tue Jan 27 10:44:35 EST 2026


Updated	 via  https://github.com/Gnucash/gnucash/commit/0b4f14e1 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/6ccbafd1 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/d64c8c8d (commit)
	from  https://github.com/Gnucash/gnucash/commit/dfe7295a (commit)



commit 0b4f14e10757686b538ce49494d7b1ee6a91c77a
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sun Jan 18 22:57:27 2026 +0800

    [Transaction.cpp] use g_list_copy_deep avoiding g_list_append

diff --git a/libgnucash/engine/Transaction.cpp b/libgnucash/engine/Transaction.cpp
index bbc9558dd0..c169700b55 100644
--- a/libgnucash/engine/Transaction.cpp
+++ b/libgnucash/engine/Transaction.cpp
@@ -625,12 +625,18 @@ dupe_trans (const Transaction *from)
  * a full fledged transaction with unique guid, splits, etc. and
  * writes it to the database.
 \********************************************************************/
+static gpointer
+copy_split (gconstpointer from_split, gpointer to)
+{
+    auto split = xaccSplitCloneNoKvp(GNC_SPLIT(from_split));
+    split->parent = GNC_TRANSACTION(to);
+    return split;
+}
+
 Transaction *
 xaccTransCloneNoKvp (const Transaction *from)
 {
     Transaction *to;
-    Split *split;
-    GList *node;
 
     qof_event_suspend();
     to = GNC_TRANSACTION(g_object_new (GNC_TYPE_TRANSACTION, nullptr));
@@ -649,12 +655,7 @@ xaccTransCloneNoKvp (const Transaction *from)
 			    qof_instance_get_book(from));
 
     xaccTransBeginEdit(to);
-    for (node = from->splits; node; node = node->next)
-    {
-        split = xaccSplitCloneNoKvp(GNC_SPLIT(node->data));
-        split->parent = to;
-        to->splits = g_list_append (to->splits, split);
-    }
+    to->splits = g_list_copy_deep (from->splits, copy_split, to);
     qof_instance_set_dirty(QOF_INSTANCE(to));
     xaccTransCommitEdit(to);
     qof_event_resume();

commit 6ccbafd1db21ffab04edad04c0ce5545e37a655e
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Fri Jan 16 11:57:08 2026 +0800

    [gnc-log-replay.cpp] don't need to strdup const char*
    
    thereby fixing leak.

diff --git a/gnucash/import-export/log-replay/gnc-log-replay.cpp b/gnucash/import-export/log-replay/gnc-log-replay.cpp
index 6685c59b0c..54a1341f92 100644
--- a/gnucash/import-export/log-replay/gnc-log-replay.cpp
+++ b/gnucash/import-export/log-replay/gnc-log-replay.cpp
@@ -549,14 +549,9 @@ void gnc_file_log_replay (GtkWindow *parent)
     FILE *log_file;
     const char * record_start_str = "===== START";
     /* NOTE: This string must match src/engine/TransLog.c (sans newline) */
-    const char * expected_header_orig = "mod\ttrans_guid\tsplit_guid\ttime_now\t"
+    const char * expected_header = "mod\ttrans_guid\tsplit_guid\ttime_now\t"
         "date_entered\tdate_posted\tacc_guid\tacc_name\tnum\tdescription\t"
         "notes\tmemo\taction\treconciled\tamount\tvalue\tdate_reconciled";
-    static char *expected_header = NULL;
-
-    /* Use g_strdup_printf so we don't get accidental tab -> space conversion */
-    if (!expected_header)
-        expected_header = g_strdup(expected_header_orig);
 
     // qof_log_set_level(GNC_MOD_IMPORT, QOF_LOG_DEBUG);
     ENTER(" ");

commit d64c8c8d59a61fe1f727421975aeb8ef063585ad
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Fri Jan 16 11:48:12 2026 +0800

    [account.cpp] remove unused static var

diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp
index 41f1705e5d..e6ea9f640d 100644
--- a/libgnucash/engine/Account.cpp
+++ b/libgnucash/engine/Account.cpp
@@ -4798,13 +4798,10 @@ dxaccAccountSetPriceSrc(Account *acc, const char *src)
 const char*
 dxaccAccountGetPriceSrc(const Account *acc)
 {
-    static char *source = nullptr;
     if (!acc) return nullptr;
 
     if (!xaccAccountIsPriced(acc)) return nullptr;
 
-    g_free (source);
-
     return get_kvp_string_path (acc, {"old-price-source"});
 }
 



Summary of changes:
 gnucash/import-export/log-replay/gnc-log-replay.cpp |  7 +------
 libgnucash/engine/Account.cpp                       |  3 ---
 libgnucash/engine/Transaction.cpp                   | 17 +++++++++--------
 3 files changed, 10 insertions(+), 17 deletions(-)



More information about the gnucash-changes mailing list