From b81980264b744de5dda6f8e5cca15c4b829c64d9 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Thu, 4 Sep 2008 15:54:03 -0300 Subject: Input: Missing DBusConnection unref --- input/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'input/main.c') 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 #include -#include #include @@ -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) -- cgit From c74f11481aabe51612c7200e1e3ab91f7f1c4abb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 6 Sep 2008 01:10:56 +0200 Subject: Fix D-Bus connection init --- input/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'input/main.c') diff --git a/input/main.c b/input/main.c index 4851324c..8df96891 100644 --- a/input/main.c +++ b/input/main.c @@ -35,8 +35,6 @@ #include "logging.h" #include "manager.h" -DBusConnection *connection = NULL; - static GKeyFile *load_config_file(const char *file) { GKeyFile *keyfile; @@ -54,6 +52,8 @@ static GKeyFile *load_config_file(const char *file) return keyfile; } +static DBusConnection *connection; + static int input_init(void) { GKeyFile *config; @@ -78,6 +78,7 @@ static int input_init(void) static void input_exit(void) { input_manager_exit(); + dbus_connection_unref(connection); } -- cgit