[Publish Calendar] Disconnect free-busy-data signal handler

Disconnect it when the free/busy query finished, because the ECalClient
can be left alive longer that in this function, thus the callback could
be called with already gone memory.
This commit is contained in:
Milan Crha
2015-06-16 08:29:24 +02:00
parent 6016826ddc
commit bbba353047

View File

@ -65,6 +65,7 @@ write_calendar (const gchar *uid,
icalcomponent *top_level;
gchar *email = NULL;
GSList *users = NULL;
gulong handler_id;
gboolean success = FALSE;
utc = icaltimezone_get_utc_timezone ();
@ -111,12 +112,16 @@ write_calendar (const gchar *uid,
top_level = e_cal_util_new_top_level ();
g_signal_connect (
handler_id = g_signal_connect (
client, "free-busy-data",
G_CALLBACK (free_busy_data_cb), &objects);
success = e_cal_client_get_free_busy_sync (
E_CAL_CLIENT (client), start, end, users, NULL, error);
if (handler_id > 0)
g_signal_handler_disconnect (client, handler_id);
if (success) {
gchar *ical_string;
GSList *iter;