gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Thu Jul 29 12:00:49 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/b8dad64b (commit)
	 via  https://github.com/Gnucash/gnucash/commit/afea6fd6 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/7ffe0a53 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/9767c863 (commit)
	from  https://github.com/Gnucash/gnucash/commit/a7808f9f (commit)



commit b8dad64b7e333935865f482fea071a8a97601836
Merge: a7808f9f1 afea6fd68
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Thu Jul 29 23:56:38 2021 +0800

    Merge branch 'maint-free-memory' into maint #1086


commit afea6fd68ba81ce61db819788d79be774f9d96d0
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Fri Jul 23 22:17:03 2021 +0800

    [gnc-report.c] free default_font_family
    
    if default_font_family is ".AppleSystemUIFont", it is not freed prior
    to returning "Arial".
    
    also default_font_family is given a g_strdup'd string therefore will
    never be NULL.

diff --git a/gnucash/report/gnc-report.c b/gnucash/report/gnc-report.c
index 14b4dafb6..970133867 100644
--- a/gnucash/report/gnc-report.c
+++ b/gnucash/report/gnc-report.c
@@ -336,9 +336,11 @@ gnc_get_default_report_font_family(void)
 
     pango_font_description_free (font_desc);
 
-    if (default_font_family == NULL ||
-        g_str_has_prefix (default_font_family, ".AppleSystemUIFont"))
-        return g_strdup("Arial");
+    if (g_str_has_prefix (default_font_family, ".AppleSystemUIFont"))
+    {
+        g_free (default_font_family);
+        return g_strdup ("Arial");
+    }
     else
         return default_font_family;
 }

commit 7ffe0a53910e6c7830996131e21291e8d842b9d5
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Jul 12 20:08:40 2021 +0800

    [gnc-tree-model-owner.c] owner_list must be freed

diff --git a/gnucash/gnome-utils/gnc-tree-model-owner.c b/gnucash/gnome-utils/gnc-tree-model-owner.c
index 95180e13f..620642fc7 100644
--- a/gnucash/gnome-utils/gnc-tree-model-owner.c
+++ b/gnucash/gnome-utils/gnc-tree-model-owner.c
@@ -192,6 +192,9 @@ gnc_tree_model_owner_finalize (GObject *object)
     model = GNC_TREE_MODEL_OWNER (object);
     priv = GNC_TREE_MODEL_OWNER_GET_PRIVATE(model);
 
+    if (priv->owner_list)
+        g_list_free_full (priv->owner_list, (GDestroyNotify) gncOwnerFree);
+
     priv->book       = NULL;
     priv->owner_list = NULL;
 
@@ -976,6 +979,9 @@ gnc_tree_model_owner_event_handler (QofInstance *entity,
         /* Tell the filters/views where the new owner was added. */
         DEBUG("add owner %p (%s)", &owner, gncOwnerGetName(&owner));
         /* First update our copy of the owner list. This isn't done automatically */
+        if (priv->owner_list)
+            g_list_free_full (priv->owner_list, (GDestroyNotify) gncOwnerFree);
+
         priv->owner_list = gncBusinessGetOwnerList (priv->book,
                            gncOwnerTypeToQofIdType(priv->owner_type), TRUE);
         increment_stamp(model);

commit 9767c8633753954098787f9f6a28bd4b2f88a573
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Jul 12 18:20:52 2021 +0800

    [engine.i] some GLists must be freed

diff --git a/bindings/engine.i b/bindings/engine.i
index e7af4047a..ef273a577 100644
--- a/bindings/engine.i
+++ b/bindings/engine.i
@@ -77,6 +77,8 @@ declarations in the header files, some of which are included by
 engine-common.i */
 
 %newobject gnc_account_get_full_name;
+%newobject xaccTransGetAPARAcctSplitList;
+%newobject xaccTransGetPaymentAcctSplitList;
 
 %include "engine-common.i"
 



Summary of changes:
 bindings/engine.i                          | 2 ++
 gnucash/gnome-utils/gnc-tree-model-owner.c | 6 ++++++
 gnucash/report/gnc-report.c                | 8 +++++---
 3 files changed, 13 insertions(+), 3 deletions(-)



More information about the gnucash-changes mailing list