diff options
Diffstat (limited to 'modules/calendar')
-rw-r--r-- | modules/calendar/e-cal-shell-backend.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c index 134f706054..749dd7ec19 100644 --- a/modules/calendar/e-cal-shell-backend.c +++ b/modules/calendar/e-cal-shell-backend.c @@ -769,8 +769,34 @@ cal_shell_backend_class_init (ECalShellBackendClass *class) static void cal_shell_backend_init (ECalShellBackend *cal_shell_backend) { + icalarray *builtin_timezones; + gint ii; + cal_shell_backend->priv = E_CAL_SHELL_BACKEND_GET_PRIVATE (cal_shell_backend); + + /* XXX Pre-load all built-in timezones in libical. + * + * Built-in time zones in libical 0.43 are loaded on demand, + * but not in a thread-safe manner, resulting in a race when + * multiple threads call icaltimezone_load_builtin_timezone() + * on the same time zone. Until built-in time zone loading + * in libical is made thread-safe, work around the issue by + * loading all built-in time zones now, so libical's internal + * time zone array will be fully populated before any threads + * are spawned. + */ + builtin_timezones = icaltimezone_get_builtin_timezones (); + for (ii = 0; ii < builtin_timezones->num_elements; ii++) { + icaltimezone *zone; + + zone = icalarray_element_at (builtin_timezones, ii); + + /* We don't care about the component right now, + * we just need some function that will trigger + * icaltimezone_load_builtin_timezone(). */ + icaltimezone_get_component (zone); + } } GType |