gnucash maint: [gnc-dense-cal] avoid GTimer leak
Christopher Lam
clam at code.gnucash.org
Fri Sep 2 10:01:29 EDT 2022
Updated via https://github.com/Gnucash/gnucash/commit/efde151a (commit)
from https://github.com/Gnucash/gnucash/commit/1998ce2a (commit)
commit efde151ad7bfd3667f9faed81e75c3a5052d4382
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Fri Sep 2 20:50:08 2022 +0800
[gnc-dense-cal] avoid GTimer leak
Not sure if this GTimer ever gets leaked, but at least this code is
now GTimer leak-free.
diff --git a/gnucash/gnome-utils/gnc-dense-cal.c b/gnucash/gnome-utils/gnc-dense-cal.c
index 9b3390dc2..8ef46cbf9 100644
--- a/gnucash/gnome-utils/gnc-dense-cal.c
+++ b/gnucash/gnome-utils/gnc-dense-cal.c
@@ -528,9 +528,10 @@ gnc_dense_cal_set_month(GncDenseCal *dcal, GDateMonth mon)
static void
_gnc_dense_cal_set_month(GncDenseCal *dcal, GDateMonth mon, gboolean redraw)
{
- GTimer *t = g_timer_new();
+ GTimer *t;
if (dcal->month == mon)
return;
+ t = g_timer_new();
dcal->month = mon;
g_timer_start(t);
recompute_first_of_month_offset(dcal);
Summary of changes:
gnucash/gnome-utils/gnc-dense-cal.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
More information about the gnucash-changes
mailing list