diff options
author | Cosimo Cecchi <cosimo.cecchi@collabora.co.uk> | 2009-07-25 23:01:33 +0800 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2009-07-30 06:13:20 +0800 |
commit | 8159c9cf091d3474702df58b04dcd11783109ab7 (patch) | |
tree | 7dcf0eaec0938c8e6bf54cfe186ee239023b62ed /libempathy/empathy-account-manager.c | |
parent | b3970ee62ba17348a793cc2d2e617f403216f728 (diff) | |
download | gsoc2013-empathy-8159c9cf091d3474702df58b04dcd11783109ab7.tar gsoc2013-empathy-8159c9cf091d3474702df58b04dcd11783109ab7.tar.gz gsoc2013-empathy-8159c9cf091d3474702df58b04dcd11783109ab7.tar.bz2 gsoc2013-empathy-8159c9cf091d3474702df58b04dcd11783109ab7.tar.lz gsoc2013-empathy-8159c9cf091d3474702df58b04dcd11783109ab7.tar.xz gsoc2013-empathy-8159c9cf091d3474702df58b04dcd11783109ab7.tar.zst gsoc2013-empathy-8159c9cf091d3474702df58b04dcd11783109ab7.zip |
Cancel the creation thread in dispose()
Diffstat (limited to 'libempathy/empathy-account-manager.c')
-rw-r--r-- | libempathy/empathy-account-manager.c | 11 |
1 files changed, 11 insertions, 0 deletions
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); |