summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2013-04-30 19:06:24 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2013-04-30 19:06:24 +0100
commitadc09f4516414218f9753dfd1c59b1571fd05b6e (patch)
tree01fc5d007da3056af881ba98678bf00ae7621497
parentc4d686364337fd8a03ec388c133fce8428bb1a57 (diff)
ServerConnection: don't leak GTask used to connect
-rw-r--r--src/idle-server-connection.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/idle-server-connection.c b/src/idle-server-connection.c
index bc7a972..9620fd8 100644
--- a/src/idle-server-connection.c
+++ b/src/idle-server-connection.c
@@ -285,6 +285,7 @@ cleanup:
}
static void _connect_to_host_ready(GObject *source_object, GAsyncResult *res, gpointer user_data) {
+ GTask *task = G_TASK (res);
GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT(user_data);
IdleServerConnection *conn = IDLE_SERVER_CONNECTION(g_async_result_get_source_object(G_ASYNC_RESULT(result)));
IdleServerConnectionPrivate *priv = IDLE_SERVER_CONNECTION_GET_PRIVATE(conn);
@@ -295,7 +296,7 @@ static void _connect_to_host_ready(GObject *source_object, GAsyncResult *res, gp
gint socket_fd;
GError *error = NULL;
- socket_connection = g_task_propagate_pointer (G_TASK (res), &error);
+ socket_connection = g_task_propagate_pointer (task, &error);
if (socket_connection == NULL) {
IDLE_DEBUG("g_socket_client_connect_to_host failed: %s", error->message);
g_simple_async_result_set_error(result, TP_ERROR, TP_ERROR_NETWORK_ERROR, "%s", error->message);
@@ -322,6 +323,7 @@ static void _connect_to_host_ready(GObject *source_object, GAsyncResult *res, gp
cleanup:
g_simple_async_result_complete(result);
g_object_unref(result);
+ g_object_unref(task);
}