]> git.0d.be Git - empathy.git/commitdiff
Don't destroy the request properties, EmpathyDispatcher now owns them
authorDanielle Madeley <danielle.madeley@collabora.co.uk>
Wed, 16 Dec 2009 21:50:33 +0000 (08:50 +1100)
committerDanielle Madeley <danielle.madeley@collabora.co.uk>
Mon, 21 Dec 2009 09:55:02 +0000 (20:55 +1100)
This is not the same as tp-glib semantics (e.g. tp_..._call_create_channel).
Add some docs to EmpathyDispatcher to explain this, for the next person.

libempathy/empathy-dispatcher.c
src/empathy-chat-window.c

index 49be0babeabce467b3c79d8a3e21888734844a19..839dababb605599336006f68f9ca2a61e1291101 100644 (file)
@@ -1610,6 +1610,19 @@ empathy_dispatcher_call_create_or_ensure_channel (
     }
 }
 
+/**
+ * empathy_dispatcher_create_channel:
+ * @self: the EmpathyDispatcher
+ * @connection: the Connection to dispatch on
+ * @request: an a{sv} map of properties for the request, i.e. using tp_asv_new()
+ * @callback: a callback for when the channel arrives (or NULL)
+ * @user_data: optional user data (or NULL)
+ *
+ * When calling this function, #EmpathyDispatcher takes ownership of your
+ * reference to @request. DO NOT unref or destroy @request. When the request is
+ * done, @request will be unreferenced. Take another reference if you want to
+ * keep it around.
+ */
 void
 empathy_dispatcher_create_channel (EmpathyDispatcher *self,
                                    TpConnection *connection,
index bea85c648fc075bf7d7f0ba39f902322639e1661..2dbe09d5d5710e4a4302f2d7c9abfb783f5c1af1 100644 (file)
@@ -856,10 +856,10 @@ chat_window_upgrade_to_muc (EmpathyChat    *chat,
            NULL);
 
        /* Although this is a MUC, it's anonymous, so CreateChannel is valid */
+       /* props now belongs to EmpathyDispatcher, don't free it */
        empathy_dispatcher_create_channel (dispatcher, connection,
                        props, NULL, NULL);
 
-       g_hash_table_destroy (props);
        g_ptr_array_free (channels, TRUE);
 
        g_object_unref (dispatcher);