=?utf-8?q?=5Bfolks=5D_Bug_683319_=E2=80=94_Crash_in_individual-aggregator?= =?utf-8?q?=3A_=5Fpersonas=5Fchanged=5Fcb?=



commit b6cd964139abb85e09fff26dce1992f4f9895f19
Author: Philip Withnall <philip tecnocode co uk>
Date:   Wed Sep 5 00:41:22 2012 +0100

    Bug 683319 â Crash in individual-aggregator: _personas_changed_cb
    
    Keep a reference to the Tpf.PersonaStoreâs self persona when emitting
    a âpersonas changedâ notification about it, so that it doesnât get unset
    in the storeâs member variable in the mean time, resulting in a null persona
    being emitted in the âpersonas changedâ signal.
    
    Closes: https://bugzilla.gnome.org/show_bug.cgi?id=683319

 NEWS                                          |    1 +
 backends/telepathy/lib/tpf-persona-store.vala |   14 +++++++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/NEWS b/NEWS
index 86e828a..cc93f5e 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,7 @@ Bugs fixed:
 â Bug 682346 â build: Make telepathy backend optional
 â Bug 682809 â Lazy instantiation of multi-valued properties
 â Bug 682719 â eds test fails to compile
+â Bug 683319 â Crash in individual-aggregator: _personas_changed_cb
 
 Overview of changes from libfolks 0.7.2 to libfolks 0.7.3
 =========================================================
diff --git a/backends/telepathy/lib/tpf-persona-store.vala b/backends/telepathy/lib/tpf-persona-store.vala
index 3fb9809..eb152d6 100644
--- a/backends/telepathy/lib/tpf-persona-store.vala
+++ b/backends/telepathy/lib/tpf-persona-store.vala
@@ -1091,13 +1091,17 @@ public class Tpf.PersonaStore : Folks.PersonaStore
       var personas_added = new HashSet<Persona> ();
       var personas_removed = new HashSet<Persona> ();
 
-      /* Remove old self persona if not also part of roster */
-      if (this._self_persona != null &&
-          !this._self_persona.is_in_contact_list &&
-          this._remove_persona (this._self_persona))
+      /* Remove old self persona if not also part of roster. Keep a reference
+       * to the persona so _remove_persona() doesn't unset it early. */
+      var self_persona = this._self_persona;
+
+      if (self_persona != null &&
+          !self_persona.is_in_contact_list &&
+          this._remove_persona (self_persona))
         {
-          personas_removed.add (this._self_persona);
+          personas_removed.add (self_persona);
         }
+
       this._self_persona = null;
 
       if (contact != null)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]