aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2009-12-17 05:50:33 +0800
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2009-12-21 17:55:02 +0800
commit91b6954805de2541dad743256cc3f9e9c6f65943 (patch)
treeb68c46ce1248ac92f8ed5fd28b1a3169c48b0479
parent041b5b174f64ddde0f400843ed2a8b89b52ba18d (diff)
downloadgsoc2013-empathy-91b6954805de2541dad743256cc3f9e9c6f65943.tar
gsoc2013-empathy-91b6954805de2541dad743256cc3f9e9c6f65943.tar.gz
gsoc2013-empathy-91b6954805de2541dad743256cc3f9e9c6f65943.tar.bz2
gsoc2013-empathy-91b6954805de2541dad743256cc3f9e9c6f65943.tar.lz
gsoc2013-empathy-91b6954805de2541dad743256cc3f9e9c6f65943.tar.xz
gsoc2013-empathy-91b6954805de2541dad743256cc3f9e9c6f65943.tar.zst
gsoc2013-empathy-91b6954805de2541dad743256cc3f9e9c6f65943.zip
Don't destroy the request properties, EmpathyDispatcher now owns them
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.
-rw-r--r--libempathy/empathy-dispatcher.c13
-rw-r--r--src/empathy-chat-window.c2
2 files changed, 14 insertions, 1 deletions
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c
index 49be0babe..839dababb 100644
--- a/libempathy/empathy-dispatcher.c
+++ b/libempathy/empathy-dispatcher.c
@@ -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,
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index bea85c648..2dbe09d5d 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -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);