aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-10-19 21:32:53 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-10-19 21:32:53 +0800
commit95580f110cf428940866d348447cee18062a468d (patch)
tree3ad518fe410ee4d2a1f7eaaf87d733aad3f3da42
parent80a7e18a8f783db81140aed9cefcd08f6b33e330 (diff)
parent21236da0d1d89af62dd4e11e883b553af658f41a (diff)
downloadgsoc2013-empathy-95580f110cf428940866d348447cee18062a468d.tar
gsoc2013-empathy-95580f110cf428940866d348447cee18062a468d.tar.gz
gsoc2013-empathy-95580f110cf428940866d348447cee18062a468d.tar.bz2
gsoc2013-empathy-95580f110cf428940866d348447cee18062a468d.tar.lz
gsoc2013-empathy-95580f110cf428940866d348447cee18062a468d.tar.xz
gsoc2013-empathy-95580f110cf428940866d348447cee18062a468d.tar.zst
gsoc2013-empathy-95580f110cf428940866d348447cee18062a468d.zip
Merge commit 'maiku/bug_598332'
-rw-r--r--libempathy/empathy-dispatcher.c53
1 files changed, 33 insertions, 20 deletions
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c
index 57c79c2e0..cc0c8198b 100644
--- a/libempathy/empathy-dispatcher.c
+++ b/libempathy/empathy-dispatcher.c
@@ -131,6 +131,7 @@ typedef struct
guint handle_type;
guint handle;
EmpathyContact *contact;
+ TpProxyPendingCall *pending_call;
/* Properties to pass to the channel when requesting it */
GHashTable *request;
@@ -284,6 +285,8 @@ free_connection_data (ConnectionData *cd)
for (l = cd->outstanding_requests ; l != NULL; l = g_list_delete_link (l,l))
{
+ DispatcherRequestData *data = l->data;
+ tp_proxy_pending_call_cancel (data->pending_call);
free_dispatcher_request_data (l->data);
}
@@ -941,6 +944,8 @@ static void
dispatcher_dispose (GObject *object)
{
EmpathyDispatcherPriv *priv = GET_PRIV (object);
+ GHashTableIter iter;
+ gpointer connection;
GList *l;
if (priv->dispose_has_run)
@@ -958,6 +963,16 @@ dispatcher_dispose (GObject *object)
g_object_unref (priv->handler);
priv->handler = NULL;
+ g_hash_table_iter_init (&iter, priv->connections);
+ while (g_hash_table_iter_next (&iter, &connection, NULL))
+ {
+ g_signal_handlers_disconnect_by_func (connection,
+ dispatcher_connection_invalidated_cb, object);
+ }
+
+ g_hash_table_destroy (priv->connections);
+ priv->connections = NULL;
+
G_OBJECT_CLASS (empathy_dispatcher_parent_class)->dispose (object);
}
@@ -988,13 +1003,6 @@ dispatcher_finalize (GObject *object)
g_list_free (priv->channels);
- g_hash_table_iter_init (&iter, priv->connections);
- while (g_hash_table_iter_next (&iter, &connection, NULL))
- {
- g_signal_handlers_disconnect_by_func (connection,
- dispatcher_connection_invalidated_cb, object);
- }
-
g_hash_table_iter_init (&iter, priv->outstanding_classes_requests);
while (g_hash_table_iter_next (&iter, &connection, (gpointer *) &list))
{
@@ -1004,7 +1012,6 @@ dispatcher_finalize (GObject *object)
g_object_unref (priv->account_manager);
- g_hash_table_destroy (priv->connections);
g_hash_table_destroy (priv->outstanding_classes_requests);
}
@@ -1291,8 +1298,9 @@ dispatcher_request_channel_cb (TpConnection *connection,
gpointer user_data,
GObject *weak_object)
{
- EmpathyDispatcher *dispatcher = EMPATHY_DISPATCHER (weak_object);
DispatcherRequestData *request_data = (DispatcherRequestData *) user_data;
+ EmpathyDispatcher *dispatcher =
+ EMPATHY_DISPATCHER (request_data->dispatcher);
dispatcher_connection_new_requested_channel (dispatcher,
request_data, object_path, NULL, error);
@@ -1322,12 +1330,13 @@ dispatcher_request_channel (DispatcherRequestData *request_data)
}
else
{
- tp_cli_connection_call_request_channel (request_data->connection, -1,
+ request_data->pending_call = tp_cli_connection_call_request_channel (
+ request_data->connection, -1,
request_data->channel_type,
request_data->handle_type,
request_data->handle,
TRUE, dispatcher_request_channel_cb,
- request_data, NULL, G_OBJECT (request_data->dispatcher));
+ request_data, NULL, NULL);
}
}
@@ -1481,10 +1490,10 @@ empathy_dispatcher_join_muc (TpConnection *connection,
connection_data->outstanding_requests = g_list_prepend
(connection_data->outstanding_requests, request_data);
- tp_cli_connection_call_request_handles (connection, -1,
+ request_data->pending_call = tp_cli_connection_call_request_handles (
+ connection, -1,
TP_HANDLE_TYPE_ROOM, names,
- dispatcher_request_handles_cb, request_data, NULL,
- G_OBJECT (dispatcher));
+ dispatcher_request_handles_cb, request_data, NULL, NULL);
g_object_unref (dispatcher);
}
@@ -1497,8 +1506,9 @@ dispatcher_create_channel_cb (TpConnection *connect,
gpointer user_data,
GObject *weak_object)
{
- EmpathyDispatcher *dispatcher = EMPATHY_DISPATCHER (weak_object);
DispatcherRequestData *request_data = (DispatcherRequestData *) user_data;
+ EmpathyDispatcher *dispatcher =
+ EMPATHY_DISPATCHER (request_data->dispatcher);
dispatcher_connection_new_requested_channel (dispatcher,
request_data, object_path, properties, error);
@@ -1513,8 +1523,9 @@ dispatcher_ensure_channel_cb (TpConnection *connect,
gpointer user_data,
GObject *weak_object)
{
- EmpathyDispatcher *dispatcher = EMPATHY_DISPATCHER (weak_object);
DispatcherRequestData *request_data = (DispatcherRequestData *) user_data;
+ EmpathyDispatcher *dispatcher =
+ EMPATHY_DISPATCHER (request_data->dispatcher);
dispatcher_connection_new_requested_channel (dispatcher,
request_data, object_path, properties, error);
@@ -1527,17 +1538,19 @@ empathy_dispatcher_call_create_or_ensure_channel (
{
if (request_data->should_ensure)
{
- tp_cli_connection_interface_requests_call_ensure_channel (
+ request_data->pending_call =
+ tp_cli_connection_interface_requests_call_ensure_channel (
request_data->connection, -1,
request_data->request, dispatcher_ensure_channel_cb,
- request_data, NULL, G_OBJECT (request_data->dispatcher));
+ request_data, NULL, NULL);
}
else
{
- tp_cli_connection_interface_requests_call_create_channel (
+ request_data->pending_call =
+ tp_cli_connection_interface_requests_call_create_channel (
request_data->connection, -1,
request_data->request, dispatcher_create_channel_cb,
- request_data, NULL, G_OBJECT (request_data->dispatcher));
+ request_data, NULL, NULL);
}
}