From 8bdeef859e7c094dbd5e2bbd6c918eb88dfb3044 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 8 Dec 2011 14:54:29 +0000 Subject: [PATCH] =?utf8?q?Bug=20665728=20=E2=80=94=20prepare()=20isn't=20m?= =?utf8?q?utually=20exclusive=20inside=20a=20single=20thread?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix Tpf.PersonaStore.prepare() to only run once, even if it's called multiple times from the same thread (e.g. if the caller wasn't yielding on the async call returning). Closes: bgo#665728 --- NEWS | 2 ++ backends/telepathy/lib/tpf-persona-store.vala | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index f1b6778..879c982 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,8 @@ Bugs fixed: * Bug 663889 — crash due to NameDetails which fail to guarantee non-null full-name/nickname * Bug 665039 — Crash in folks_backends_sw_backend_add_service +* Bug 665728 — TpfPersonaStore: prepare() isn't mutually exclusive inside a + single thread Overview of changes from libfolks 0.6.4.1 to libfolks 0.6.5 ============================================================= diff --git a/backends/telepathy/lib/tpf-persona-store.vala b/backends/telepathy/lib/tpf-persona-store.vala index e3a49a1..567ec17 100644 --- a/backends/telepathy/lib/tpf-persona-store.vala +++ b/backends/telepathy/lib/tpf-persona-store.vala @@ -99,6 +99,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore private MaybeBool _can_group_personas = MaybeBool.UNSET; private MaybeBool _can_remove_personas = MaybeBool.UNSET; private bool _is_prepared = false; + private bool _prepare_pending = false; private bool _is_quiescent = false; private bool _got_stored_channel_members = false; private bool _got_self_handle = false; @@ -561,8 +562,10 @@ public class Tpf.PersonaStore : Folks.PersonaStore { lock (this._is_prepared) { - if (!this._is_prepared) + if (!this._is_prepared && !this._prepare_pending) { + this._prepare_pending = true; + this._account_manager = AccountManager.dup (); this._account_manager.account_removed.connect ((a) => @@ -626,6 +629,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore } this._is_prepared = true; + this._prepare_pending = false; this.notify_property ("is-prepared"); } } -- 2.7.4