diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-09-08 10:30:05 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-09-08 10:30:05 +0300 |
commit | 17370895fde2d210bb50dfaa1c89fe6601de3467 (patch) | |
tree | 2797d5e061b7948a53f270f9ccfcc31b1c0ad6f5 /audio/main.c | |
parent | fa141e676e82cd20082779c086d1fef6427fdc20 (diff) | |
parent | 393416b170d6e4b2b7406418d63c7be2aefda70f (diff) |
Merge branch 'master' of ssh://master.kernel.org/pub/scm/bluetooth/bluez
Diffstat (limited to 'audio/main.c')
-rw-r--r-- | audio/main.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/audio/main.c b/audio/main.c index 9afc61e6..4583ca81 100644 --- a/audio/main.c +++ b/audio/main.c @@ -29,7 +29,6 @@ #include <errno.h> #include <sys/socket.h> #include <bluetooth/bluetooth.h> -#include <bluetooth/sdp.h> #include <glib.h> #include <dbus/dbus.h> @@ -57,13 +56,14 @@ static GKeyFile *load_config_file(const char *file) return keyfile; } +static DBusConnection *connection; + static int audio_init(void) { - DBusConnection *conn; GKeyFile *config; - conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL); - if (conn == NULL) + connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL); + if (connection == NULL) return -EIO; config = load_config_file(CONFIGDIR "/audio.conf"); @@ -73,8 +73,8 @@ static int audio_init(void) return -EIO; } - if (audio_manager_init(conn, config) < 0) { - dbus_connection_unref(conn); + if (audio_manager_init(connection, config) < 0) { + dbus_connection_unref(connection); return -EIO; } @@ -86,6 +86,8 @@ static void audio_exit(void) audio_manager_exit(); unix_exit(); + + dbus_connection_unref(connection); } BLUETOOTH_PLUGIN_DEFINE("audio", audio_init, audio_exit) |