summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2013-04-30 19:08:15 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2013-04-30 19:08:15 +0100
commit18155960b9034f6adfafe67b6c0560ad3ef40252 (patch)
tree79290efdf2eb50092ff2e8f98ecf55e14b87abf4
parentadc09f4516414218f9753dfd1c59b1571fd05b6e (diff)
ServerConnection: ensure socket connection is not leaked
If we cancel the connect_async cancellable between the call to g_task_return_pointer (which schedules an idle to call the callback) and Connection calling connect_finish(), the socket_connection would previously have leaked.
-rw-r--r--src/idle-server-connection.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/idle-server-connection.c b/src/idle-server-connection.c
index 9620fd8..0795e63 100644
--- a/src/idle-server-connection.c
+++ b/src/idle-server-connection.c
@@ -394,7 +394,7 @@ static void _connect_in_thread (GTask *task, gpointer source_object, gpointer ta
socket_connection = g_socket_client_connect_to_host (priv->socket_client, priv->host, priv->port, cancellable, &error);
g_signal_handler_disconnect (priv->socket_client, event_id);
if (socket_connection != NULL)
- g_task_return_pointer (task, socket_connection, NULL);
+ g_task_return_pointer (task, socket_connection, g_object_unref);
else
g_task_return_error (task, error);
}