summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-02-05 12:40:34 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-02-06 13:06:26 +0000
commit5090a5d462bfaa62300fa0526c043f60759306a6 (patch)
tree2df5db0174c6ff273940c824ebf41b771dc346c8
parenta48f28886f8417dcd10da01cb4e1330e59390119 (diff)
McdAccountManager: if an account is async-added during setup, wait for it
Previously, we'd only wait for accounts added in mcd_storage_load() to become ready. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=74581 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
-rw-r--r--src/mcd-account-manager.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c
index 593e6989..489de45a 100644
--- a/src/mcd-account-manager.c
+++ b/src/mcd-account-manager.c
@@ -100,6 +100,7 @@ typedef struct
McpAccountStorage *storage_plugin;
McdAccount *account;
gint account_lock;
+ gboolean holds_setup_lock;
} McdLoadAccountsData;
typedef struct
@@ -296,6 +297,12 @@ created_cb (GObject *storage_plugin_obj,
lad->storage_plugin = g_object_ref (plugin);
lad->account_lock = 1; /* released at the end of this function */
lad->account = g_object_ref (account);
+
+ if (self->priv->setup_lock > 0)
+ {
+ lad->holds_setup_lock = TRUE;
+ self->priv->setup_lock++;
+ }
}
else
{
@@ -1132,6 +1139,9 @@ release_load_accounts_lock (McdLoadAccountsData *lad)
if (lad->account_lock == 0)
{
+ if (lad->holds_setup_lock)
+ release_setup_lock (lad->account_manager);
+
g_object_unref (lad->account_manager);
g_object_unref (lad->storage_plugin);
g_object_unref (lad->account);