aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-11-24 21:28:53 +0800
committerMilan Crha <mcrha@redhat.com>2010-11-24 21:28:53 +0800
commiteeec90235abe465e9cc49194b55ee2635faf023f (patch)
tree796493e0b7dceb60e7763d498e9a3a427d5a7f9c /calendar
parent51d17b48e4ba74c17cc0ac30f9e956cdb380be9b (diff)
downloadgsoc2013-evolution-eeec90235abe465e9cc49194b55ee2635faf023f.tar.gz
gsoc2013-evolution-eeec90235abe465e9cc49194b55ee2635faf023f.tar.zst
gsoc2013-evolution-eeec90235abe465e9cc49194b55ee2635faf023f.zip
Bug #635673 - Stack overflow when opening slow calendar
Diffstat (limited to 'calendar')
-rw-r--r--calendar/common/authentication.c1
-rw-r--r--calendar/gui/e-cal-model.c21
2 files changed, 18 insertions, 4 deletions
diff --git a/calendar/common/authentication.c b/calendar/common/authentication.c
index 0420f1f5b5..286b7d6c46 100644
--- a/calendar/common/authentication.c
+++ b/calendar/common/authentication.c
@@ -274,6 +274,7 @@ fail:
} else if (g_error_matches (
error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_BUSY)) {
g_clear_error (&error);
+ g_usleep (250000);
goto try_again;
} else {
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index 294b54c760..f33a6f55c1 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -2524,6 +2524,19 @@ backend_died_cb (ECal *client, gpointer user_data)
e_cal_model_remove_client (model, client);
}
+static gboolean
+wait_open_cb (gpointer data)
+{
+ ECal *client = data;
+
+ g_return_val_if_fail (client != NULL, FALSE);
+ g_return_val_if_fail (E_IS_CAL (client), FALSE);
+
+ e_cal_open_async (client, FALSE);
+
+ return FALSE;
+}
+
static void
cal_opened_cb (ECal *client, const GError *error, gpointer user_data)
{
@@ -2531,10 +2544,13 @@ cal_opened_cb (ECal *client, const GError *error, gpointer user_data)
ECalModelClient *client_data;
if (g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_BUSY)) {
- e_cal_open_async (client, FALSE);
+ g_timeout_add (250, wait_open_cb, client);
return;
}
+ /* Stop listening for this calendar to be opened */
+ g_signal_handlers_disconnect_matched (client, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, NULL, cal_opened_cb, model);
+
if (error) {
e_cal_model_remove_client (model, client);
e_cal_model_update_status_message (model, NULL, -1.0);
@@ -2543,9 +2559,6 @@ cal_opened_cb (ECal *client, const GError *error, gpointer user_data)
e_cal_model_update_status_message (model, NULL, -1.0);
- /* Stop listening for this calendar to be opened */
- g_signal_handlers_disconnect_matched (client, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, NULL, cal_opened_cb, model);
-
client_data = find_client_data (model, client);
g_return_if_fail (client_data);