aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-04-10 15:54:37 +0300
committerMarcel Holtmann <marcel@holtmann.org>2015-04-20 09:04:22 +0200
commitbfdce916968574effb4eec446f1ee61d2b5dcf80 (patch)
treeb28330af9fa993640024dab1f87778146e4668d6
parent09cea336c3d6099cca155368b06bbb1b55796386 (diff)
downloadmmsd-bfdce916968574effb4eec446f1ee61d2b5dcf80.tar.gz
gdbus: Close private connection if setup fails
Private connection should be properly closed with dbus_connection_close otherwise libdbus exits with the following error: 'The last reference on a connection was dropped without closing the connection. This is a bug in an application. See dbus_connection_unref() documentation for details. Most likely, the application was supposed to call dbus_connection_close(), since this is a private connection.'
-rw-r--r--gdbus/mainloop.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdbus/mainloop.c b/gdbus/mainloop.c
index 3e88eac..b90a844 100644
--- a/gdbus/mainloop.c
+++ b/gdbus/mainloop.c
@@ -322,6 +322,7 @@ DBusConnection *g_dbus_setup_private(DBusBusType type, const char *name,
return NULL;
if (setup_bus(conn, name, error) == FALSE) {
+ dbus_connection_close(conn);
dbus_connection_unref(conn);
return NULL;
}