From d994e92e272bf0788f9f63190e0efc6f834d17a9 Mon Sep 17 00:00:00 2001 From: Steven Jackson Date: Sun, 7 Sep 2014 18:38:13 +0100 Subject: [PATCH] Check that the month change timer source still exists before removal. --- src/mainbox.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mainbox.c b/src/mainbox.c index 8d7b8af..87eda1f 100644 --- a/src/mainbox.c +++ b/src/mainbox.c @@ -273,8 +273,12 @@ void mCalendar_month_changed_cb(GtkCalendar *calendar, gpointer user_data) * running updates since this new one will overwrite them anyway. * Let's clear still the view to fix bug 3913 (only needed * if there are changes in the calendar) */ - if (timer) - g_source_remove(timer); + if (timer) { + GSource *source = g_main_context_find_source_by_id(NULL, timer); + if(source && !g_source_is_destroyed(source)) + g_source_remove(timer); + } + if (calendar->num_marked_dates) /* undocumented, internal field; ugly */ gtk_calendar_clear_marks(calendar); timer = g_timeout_add(400, (GtkFunction)upd_calendar, calendar); -- 1.9.1