diff options
| author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2008-09-04 15:54:03 -0300 | 
|---|---|---|
| committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2008-09-05 16:08:30 -0300 | 
| commit | b81980264b744de5dda6f8e5cca15c4b829c64d9 (patch) | |
| tree | 8aaf91ed271c8174630663012504bb9465b568a1 | |
| parent | 6299ff3c17ae5d77165edd147ee20495947a549e (diff) | |
Input: Missing DBusConnection unref
| -rw-r--r-- | input/main.c | 13 | 
1 files changed, 7 insertions, 6 deletions
| diff --git a/input/main.c b/input/main.c index d3d152e0..4851324c 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> @@ -36,6 +35,8 @@  #include "logging.h"  #include "manager.h" +DBusConnection *connection = NULL; +  static GKeyFile *load_config_file(const char *file)  {  	GKeyFile *keyfile; @@ -56,16 +57,15 @@ static GKeyFile *load_config_file(const char *file)  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,7 @@ 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) | 
