summaryrefslogtreecommitdiffstats
path: root/network/main.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-09-08 10:30:05 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2008-09-08 10:30:05 +0300
commit17370895fde2d210bb50dfaa1c89fe6601de3467 (patch)
tree2797d5e061b7948a53f270f9ccfcc31b1c0ad6f5 /network/main.c
parentfa141e676e82cd20082779c086d1fef6427fdc20 (diff)
parent393416b170d6e4b2b7406418d63c7be2aefda70f (diff)
Merge branch 'master' of ssh://master.kernel.org/pub/scm/bluetooth/bluez
Diffstat (limited to 'network/main.c')
-rw-r--r--network/main.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/network/main.c b/network/main.c
index 6efdb81d..b81c111b 100644
--- a/network/main.c
+++ b/network/main.c
@@ -32,16 +32,16 @@
#include "plugin.h"
#include "manager.h"
+static DBusConnection *connection;
+
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 +51,8 @@ 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)