]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-account-manager.c
Cancel the creation thread in dispose()
[empathy.git] / libempathy / empathy-account-manager.c
index b9694a95b221f9d67974810b11a9d2c23e54ff1d..2d6977d3cf396a865ee7cf3b6f009e73a0cc9f81 100644 (file)
@@ -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);