diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2018-06-01 17:16:35 +0200 |
---|---|---|
committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2018-06-04 22:41:24 +0200 |
commit | 394acd568e7b986fd155e298153a895f2759f3cd (patch) | |
tree | 4cf3ba10170581419d6de108e07ebb5efa318c6a | |
parent | f5f38ef0079be5d1e7636daba395c38aaf887de8 (diff) | |
download | gdm-394acd568e7b986fd155e298153a895f2759f3cd.tar.gz |
libgdm: Don't double-ref the connection got from task
Both if we re-use the shared connection in `gdm_client_get_connection` and if
we create a new one in `on_connected`, we steal the pointer here by using
`g_task_propagate_pointer` and thus we don't have to add an additional
reference to this connection when returning, or it won't ever be consumed by
function customers.
-rw-r--r-- | libgdm/gdm-client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libgdm/gdm-client.c b/libgdm/gdm-client.c index fa4ba842..36292148 100644 --- a/libgdm/gdm-client.c +++ b/libgdm/gdm-client.c @@ -536,7 +536,7 @@ gdm_client_get_connection_finish (GdmClient *client, GAsyncResult *result, GError **error) { - GDBusConnection *connection = NULL; + GDBusConnection *connection; g_return_val_if_fail (GDM_IS_CLIENT (client), FALSE); @@ -551,7 +551,7 @@ gdm_client_get_connection_finish (GdmClient *client, (gpointer *) &client->priv->connection); } - return g_object_ref (connection); + return connection; } static void |