Bug 683319 — Crash in individual-aggregator: _personas_changed_cb
authorPhilip Withnall <philip@tecnocode.co.uk>
Tue, 4 Sep 2012 23:41:22 +0000 (00:41 +0100)
committerPhilip Withnall <philip@tecnocode.co.uk>
Wed, 5 Sep 2012 19:57:36 +0000 (20:57 +0100)
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
backends/telepathy/lib/tpf-persona-store.vala

diff --git a/NEWS b/NEWS
index 86e828a..cc93f5e 100644 (file)
--- 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
 =========================================================
index 3fb9809..eb152d6 100644 (file)
@@ -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)