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 /input/main.c | |
| parent | fa141e676e82cd20082779c086d1fef6427fdc20 (diff) | |
| parent | 393416b170d6e4b2b7406418d63c7be2aefda70f (diff) | |
Merge branch 'master' of ssh://master.kernel.org/pub/scm/bluetooth/bluez
Diffstat (limited to 'input/main.c')
| -rw-r--r-- | input/main.c | 14 | 
1 files changed, 8 insertions, 6 deletions
diff --git a/input/main.c b/input/main.c index d3d152e0..8df96891 100644 --- a/input/main.c +++ b/input/main.c @@ -28,7 +28,6 @@  #include <errno.h>  #include <bluetooth/bluetooth.h> -#include <bluetooth/sdp.h>  #include <gdbus.h> @@ -53,19 +52,20 @@ static GKeyFile *load_config_file(const char *file)  	return keyfile;  } +static DBusConnection *connection; +  static int input_init(void)  {  	GKeyFile *config; -	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;  	config = load_config_file(CONFIGDIR "/input.conf"); -	if (input_manager_init(conn, config) < 0) { -		dbus_connection_unref(conn); +	if (input_manager_init(connection, config) < 0) { +		dbus_connection_unref(connection);  		return -EIO;  	} @@ -78,6 +78,8 @@ static int input_init(void)  static void input_exit(void)  {  	input_manager_exit(); + +	dbus_connection_unref(connection);  }  BLUETOOTH_PLUGIN_DEFINE("input", input_init, input_exit)  | 
