From 66296dadd3be43341d9991097f972aedd525ea06 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Fri, 18 Mar 2005 12:39:37 +0000 Subject: Fixes #68525, 68580 Added a boolean variable to avoid crash when a race 2005-03-17 Chenthill Palanisamy Fixes #68525, 68580 * gui/gnome-cal.c (update_query), (gnome_calendar_init): Added a boolean variable to avoid crash when a race condition occurs. svn path=/trunk/; revision=29062 --- calendar/gui/gnome-cal.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'calendar/gui') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 3a85a4a89f..5c8d6e0ad1 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -175,6 +175,7 @@ struct _GnomeCalendarPrivate { 'dates-shown-changed' signal.*/ time_t visible_start; time_t visible_end; + gboolean updating; }; /* Signal IDs */ @@ -715,9 +716,13 @@ update_query (GnomeCalendar *gcal) priv = gcal->priv; + if (priv->updating == TRUE) { + return; + } e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), _("Updating query")); e_calendar_item_clear_marks (priv->date_navigator->calitem); + priv->updating = TRUE; /* free the previous queries */ for (l = priv->dn_queries; l != NULL; l = l->next) { old_query = l->data; @@ -737,6 +742,7 @@ update_query (GnomeCalendar *gcal) real_sexp = adjust_e_cal_view_sexp (gcal, priv->sexp); if (!real_sexp) { e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL); + priv->updating = FALSE; return; /* No time range is set, so don't start a query */ } @@ -768,6 +774,7 @@ update_query (GnomeCalendar *gcal) } /* free memory */ + priv->updating = FALSE; g_free (real_sexp); e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL); update_todo_view (gcal); @@ -1412,6 +1419,7 @@ gnome_calendar_init (GnomeCalendar *gcal) priv->visible_start = -1; priv->visible_end = -1; + priv->updating = FALSE; } static void -- cgit v1.2.3