[empathy] When setting an EmpathyContact's Persona, disconnect existing signal handler



commit 4f79cd98c0501367570bc140776b5ec40bfee49c
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Mon Aug 23 11:37:42 2010 -0700

    When setting an EmpathyContact's Persona, disconnect existing signal handler

 libempathy/empathy-contact.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index 2605431..ea78476 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -822,7 +822,11 @@ empathy_contact_set_persona (EmpathyContact *contact,
     return;
 
   if (priv->persona != NULL)
-    g_object_unref (priv->persona);
+    {
+      g_signal_handlers_disconnect_by_func (priv->persona,
+          folks_persona_notify_cb, contact);
+      g_object_unref (priv->persona);
+    }
   priv->persona = g_object_ref (persona);
 
   g_signal_connect (priv->persona, "notify",



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