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.'
This commit is contained in:
Luiz Augusto von Dentz 2015-04-10 15:54:37 +03:00 committed by Marcel Holtmann
parent 97abe1751d
commit a5b040b781
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}