aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-08-17 23:37:28 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-08-17 23:37:28 +0800
commit65e338cadaca67c77e418903d6887ee0f0196827 (patch)
tree21a0632b759070881595ac7e34c1a7413aa78b6a
parentad9ed2451356457afaceddc7d0dc6b8b74a83bf6 (diff)
downloadgsoc2013-empathy-65e338cadaca67c77e418903d6887ee0f0196827.tar
gsoc2013-empathy-65e338cadaca67c77e418903d6887ee0f0196827.tar.gz
gsoc2013-empathy-65e338cadaca67c77e418903d6887ee0f0196827.tar.bz2
gsoc2013-empathy-65e338cadaca67c77e418903d6887ee0f0196827.tar.lz
gsoc2013-empathy-65e338cadaca67c77e418903d6887ee0f0196827.tar.xz
gsoc2013-empathy-65e338cadaca67c77e418903d6887ee0f0196827.tar.zst
gsoc2013-empathy-65e338cadaca67c77e418903d6887ee0f0196827.zip
No need to check if create_results exists in dispose
-rw-r--r--libempathy/empathy-account-manager.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/libempathy/empathy-account-manager.c b/libempathy/empathy-account-manager.c
index 00c5cb14f..12ecff1aa 100644
--- a/libempathy/empathy-account-manager.c
+++ b/libempathy/empathy-account-manager.c
@@ -490,32 +490,28 @@ do_dispose (GObject *obj)
{
EmpathyAccountManager *manager = EMPATHY_ACCOUNT_MANAGER (obj);
EmpathyAccountManagerPriv *priv = GET_PRIV (manager);
+ GHashTableIter iter;
+ GSimpleAsyncResult *result;
if (priv->dispose_run)
return;
priv->dispose_run = TRUE;
- if (priv->create_results != NULL)
+ /* the manager is being destroyed while there are account creation
+ * processes pending; this should not happen, but emit the callbacks
+ * with an error anyway.
+ */
+ g_hash_table_iter_init (&iter, priv->create_results);
+ while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &result))
{
- /* the manager is being destroyed while there are account creation
- * processes pending; this should not happen, but emit the callbacks
- * with an error anyway.
- */
- GHashTableIter iter;
- GSimpleAsyncResult *result;
-
- g_hash_table_iter_init (&iter, priv->create_results);
- while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &result))
- {
- g_simple_async_result_set_error (result, G_IO_ERROR,
- G_IO_ERROR_CANCELLED, "The account manager was disposed while "
- "creating the account");
- g_simple_async_result_complete (result);
- g_object_unref (result);
- }
+ g_simple_async_result_set_error (result, G_IO_ERROR,
+ G_IO_ERROR_CANCELLED, "The account manager was disposed while "
+ "creating the account");
+ g_simple_async_result_complete (result);
+ g_object_unref (result);
}
-
+ g_hash_table_remove_all (priv->create_results);
if (priv->dbus != NULL)
{