From 8159c9cf091d3474702df58b04dcd11783109ab7 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Sat, 25 Jul 2009 17:01:33 +0200 Subject: Cancel the creation thread in dispose() --- libempathy/empathy-account-manager.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libempathy/empathy-account-manager.c b/libempathy/empathy-account-manager.c index b9694a95b..2d6977d3c 100644 --- a/libempathy/empathy-account-manager.c +++ b/libempathy/empathy-account-manager.c @@ -299,6 +299,7 @@ account_manager_account_ready_cb (GObject *obj, g_simple_async_result_complete (priv->create_result); g_object_unref (priv->create_result); + priv->create_result = NULL; } g_signal_emit (manager, signals[ACCOUNT_CREATED], 0, account); @@ -479,6 +480,16 @@ do_dispose (GObject *obj) priv->dispose_run = TRUE; + if (priv->create_result != NULL) + { + g_simple_async_result_set_error (priv->create_result, G_IO_ERROR, + G_IO_ERROR_CANCELLED, "The account manager was disposed while " + "creating the account"); + g_simple_async_result_complete (priv->create_result); + g_object_unref (priv->create_result); + priv->create_result = NULL; + } + tp_dbus_daemon_cancel_name_owner_watch (priv->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, account_manager_name_owner_cb, manager); -- cgit v1.2.3