[empathy] empathy.c: document how the reference on the newly created EmpathyChat is managed



commit a7b6b344618cceca174eea62954373edf84543ac
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Oct 22 17:28:38 2009 +0100

    empathy.c: document how the reference on the newly created EmpathyChat is managed

 src/empathy.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/empathy.c b/src/empathy.c
index 9fddda2..6921076 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -118,9 +118,16 @@ dispatch_cb (EmpathyDispatcher *dispatcher,
         }
 
       if (chat)
-        empathy_chat_set_tp_chat (chat, tp_chat);
+        {
+          empathy_chat_set_tp_chat (chat, tp_chat);
+        }
       else
-        chat = empathy_chat_new (tp_chat);
+        {
+          chat = empathy_chat_new (tp_chat);
+          /* empathy_chat_new returns a floating reference as EmpathyChat is
+           * a GtkWidget. This reference will be taken by a container
+           * (a GtkNotebook) when we'll call empathy_chat_window_present_chat */
+        }
 
       empathy_chat_window_present_chat (chat);
 



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