Network: Missing DBusConnection unref

This commit is contained in:
Claudio Takahasi 2008-09-04 15:53:06 -03:00
parent 9ab6fa037c
commit 6299ff3c17

View File

@ -32,16 +32,17 @@
#include "plugin.h"
#include "manager.h"
static DBusConnection *connection = NULL;
static int network_init(void)
{
DBusConnection *conn;
conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
if (conn == NULL)
connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
if (connection == NULL)
return -EIO;
if (network_manager_init(conn) < 0) {
dbus_connection_unref(conn);
if (network_manager_init(connection) < 0) {
dbus_connection_unref(connection);
return -EIO;
}
@ -51,6 +52,7 @@ static int network_init(void)
static void network_exit(void)
{
network_manager_exit();
dbus_connection_unref(connection);
}
BLUETOOTH_PLUGIN_DEFINE("network", network_init, network_exit)