From 7f0602c49e82be9ee88fb2fac1c6ec816ec9d2ab Mon Sep 17 00:00:00 2001 From: Steven Jackson Date: Sun, 7 Sep 2014 18:27:51 +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..d97551a 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