gnucash maint: Multiple changes pushed
Christopher Lam
clam at code.gnucash.org
Tue Feb 9 18:09:45 EST 2021
Updated via https://github.com/Gnucash/gnucash/commit/f0ff1675 (commit)
via https://github.com/Gnucash/gnucash/commit/c20a588e (commit)
from https://github.com/Gnucash/gnucash/commit/449c298f (commit)
commit f0ff1675b88d92ac7ad3f860c8e69466564b542c
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Wed Feb 10 06:31:10 2021 +0800
[dialog-payment.c] fix memory leak
rather obscure: after assigning a payment and printing a check.
diff --git a/gnucash/gnome/dialog-payment.c b/gnucash/gnome/dialog-payment.c
index 539e47397..2657b084f 100644
--- a/gnucash/gnome/dialog-payment.c
+++ b/gnucash/gnome/dialog-payment.c
@@ -1037,6 +1037,7 @@ gnc_payment_ok_cb (G_GNUC_UNUSED GtkWidget *widget, gpointer data)
GList *splits = NULL;
splits = g_list_append(splits, split);
gnc_ui_print_check_dialog_create(NULL, splits);
+ g_list_free (splits);
}
gnc_ui_payment_window_destroy (pw);
commit c20a588e0f4667eb41d76aeac640bc3c28ce5532
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Tue Feb 9 23:41:17 2021 +0800
Don't use g_list_append unnecessarily
diff --git a/gnucash/gnome-utils/dialog-commodity.c b/gnucash/gnome-utils/dialog-commodity.c
index f5dcbfbc1..b1a50e6a5 100644
--- a/gnucash/gnome-utils/dialog-commodity.c
+++ b/gnucash/gnome-utils/dialog-commodity.c
@@ -470,8 +470,8 @@ gnc_ui_update_commodity_picker (GtkWidget *cbwe,
for (iterator = commodities; iterator; iterator = iterator->next)
{
commodity_items =
- g_list_append(commodity_items,
- (gpointer) gnc_commodity_get_printname(iterator->data));
+ g_list_prepend (commodity_items,
+ (gpointer) gnc_commodity_get_printname(iterator->data));
}
g_list_free(commodities);
diff --git a/gnucash/gnome/dialog-price-edit-db.c b/gnucash/gnome/dialog-price-edit-db.c
index 341ba840d..399bd100d 100644
--- a/gnucash/gnome/dialog-price-edit-db.c
+++ b/gnucash/gnome/dialog-price-edit-db.c
@@ -305,13 +305,13 @@ gnc_prices_dialog_get_commodities (GtkTreeView *view)
if (gtk_tree_model_get_iter (model, &iter, row->data))
{
gtk_tree_model_get (model, &iter, PRICED_COMM, &comm, -1);
- comm_list = g_list_append (comm_list, comm);
+ comm_list = g_list_prepend (comm_list, comm);
}
}
g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
g_list_free (list);
- return comm_list;
+ return g_list_reverse (comm_list);
}
static void
diff --git a/libgnucash/engine/qofquery.cpp b/libgnucash/engine/qofquery.cpp
index 5af856039..8e92136a4 100644
--- a/libgnucash/engine/qofquery.cpp
+++ b/libgnucash/engine/qofquery.cpp
@@ -982,11 +982,11 @@ GSList * qof_query_get_term_type (QofQuery *q, QofQueryParamList *term_param)
{
QofQueryTerm *qt = static_cast<QofQueryTerm*>(_and_->data);
if (!param_list_cmp (term_param, qt->param_list))
- results = g_slist_append(results, qt->pdata);
+ results = g_slist_prepend (results, qt->pdata);
}
}
- return results;
+ return g_slist_reverse (results);
}
void qof_query_destroy (QofQuery *q)
Summary of changes:
gnucash/gnome-utils/dialog-commodity.c | 4 ++--
gnucash/gnome/dialog-payment.c | 1 +
gnucash/gnome/dialog-price-edit-db.c | 4 ++--
libgnucash/engine/qofquery.cpp | 4 ++--
4 files changed, 7 insertions(+), 6 deletions(-)
More information about the gnucash-changes
mailing list