[folks] telepathy: Fix weak_unref() warnings



commit 6d32d4660e85b81f535c3515c607450ce712c4e7
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Mar 26 19:38:49 2012 +0100

    telepathy: Fix weak_unref() warnings
    
    If a TpContact is destroyed and our weak reference handler is invoked, it
    could previously not remove the TpContact's pointer from the map of weak
    references held by the persona store. When the persona was later destroyed,
    it would call weak_unref() on the stale pointer and cause a warning.
    
    This patch ensures we always remove pointers from the map when their
    weak notification functions are called.

 backends/telepathy/lib/tpf-persona-store.vala |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/backends/telepathy/lib/tpf-persona-store.vala b/backends/telepathy/lib/tpf-persona-store.vala
index 946cc76..423d07e 100644
--- a/backends/telepathy/lib/tpf-persona-store.vala
+++ b/backends/telepathy/lib/tpf-persona-store.vala
@@ -2077,6 +2077,8 @@ public class Tpf.PersonaStore : Folks.PersonaStore
       if (this._weakly_referenced_contacts != null)
         {
           Handle handle = this._weakly_referenced_contacts.get (c);
+          this._weakly_referenced_contacts.unset (c);
+
           if (handle != 0)
             {
               this._ignore_by_handle ((!) handle, null, null,



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