diff options
author | Milan Crha <mcrha@redhat.com> | 2010-11-24 21:28:53 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:04 +0800 |
commit | 57185da9834daeb3169b6e76bc817cb659648450 (patch) | |
tree | f2a6ac84ed9198d8e3db966601f36c55065a4494 | |
parent | aaf95d222df880565db862c953638dcb04e8dbb7 (diff) | |
download | gsoc2013-evolution-57185da9834daeb3169b6e76bc817cb659648450.tar.gz gsoc2013-evolution-57185da9834daeb3169b6e76bc817cb659648450.tar.zst gsoc2013-evolution-57185da9834daeb3169b6e76bc817cb659648450.zip |
Bug #635673 - Stack overflow when opening slow calendar
-rw-r--r-- | calendar/common/authentication.c | 1 | ||||
-rw-r--r-- | calendar/gui/e-cal-model.c | 21 |
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); |