[gdm/rhel-7.9: 34/51] libgdm: Don't double-ref the connection got from task
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm/rhel-7.9: 34/51] libgdm: Don't double-ref the connection got from task
- Date: Mon, 12 Apr 2021 20:58:09 +0000 (UTC)
commit 01a0f4d0a4c497c046e619c162a1d01a29087385
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Fri Jun 1 17:16:35 2018 +0200
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.
libgdm/gdm-client.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libgdm/gdm-client.c b/libgdm/gdm-client.c
index fa4ba8426..36292148c 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]