[folks/folks-0-4] Bug 647562 — Don't crash on duplicate group channels
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks/folks-0-4] Bug 647562 — Don't crash on duplicate group channels
- Date: Sat, 16 Apr 2011 13:18:02 +0000 (UTC)
commit 41a374324c60eb46548a894fc37a1eece62375ab
Author: Philip Withnall <philip withnall collabora co uk>
Date: Tue Apr 12 16:08:40 2011 +0100
Bug 647562 â?? Don't crash on duplicate group channels
NEWS | 1 +
backends/telepathy/lib/tpf-persona-store.vala | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index 0181007..010edb7 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Bugs fixed:
* Bug 645411 â?? folks-import segfaults on startup
* Crasher when removing Personas
* Bug 645680 â?? Use random integer IDs for Kf.Personas
+* Bug 647562 â?? Don't crash on duplicate group channels
Overview of changes from libfolks 0.4.0 to libfolks 0.4.1
=========================================================
diff --git a/backends/telepathy/lib/tpf-persona-store.vala b/backends/telepathy/lib/tpf-persona-store.vala
index c537fdc..c174b44 100644
--- a/backends/telepathy/lib/tpf-persona-store.vala
+++ b/backends/telepathy/lib/tpf-persona-store.vala
@@ -1109,6 +1109,23 @@ public class Tpf.PersonaStore : Folks.PersonaStore
var c = (Channel) s;
var name = c.get_identifier ();
+ var existing_channel = this._groups[name];
+ if (existing_channel != null)
+ {
+ /* Somehow, this group channel has already been set up. We have to
+ * hold a reference to the existing group while unsetting it in
+ * the group map so that unsetting it doesn't cause it to be
+ * destroyed. If that were to happen, channel_invalidated_cb()
+ * would remove it from the group map a second time, causing a
+ * double unref. */
+ existing_channel.ref ();
+ this._groups.unset (name);
+ existing_channel.unref ();
+ }
+
+ /* Drop all references before we set the new channel */
+ existing_channel = null;
+
this._groups[name] = c;
this._group_channels_unready.unset (name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]