diff options
-rw-r--r-- | audio/main.c | 4 | ||||
-rw-r--r-- | input/main.c | 5 | ||||
-rw-r--r-- | network/main.c | 4 | ||||
-rw-r--r-- | serial/main.c | 3 |
4 files changed, 9 insertions, 7 deletions
diff --git a/audio/main.c b/audio/main.c index bf0e4884..4583ca81 100644 --- a/audio/main.c +++ b/audio/main.c @@ -39,8 +39,6 @@ #include "device.h" #include "manager.h" -static DBusConnection *connection = NULL; - static GKeyFile *load_config_file(const char *file) { GError *err = NULL; @@ -58,6 +56,8 @@ static GKeyFile *load_config_file(const char *file) return keyfile; } +static DBusConnection *connection; + static int audio_init(void) { GKeyFile *config; 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); } diff --git a/network/main.c b/network/main.c index 2307a165..b81c111b 100644 --- a/network/main.c +++ b/network/main.c @@ -32,11 +32,10 @@ #include "plugin.h" #include "manager.h" -static DBusConnection *connection = NULL; +static DBusConnection *connection; static int network_init(void) { - connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL); if (connection == NULL) return -EIO; @@ -52,6 +51,7 @@ static int network_init(void) static void network_exit(void) { network_manager_exit(); + dbus_connection_unref(connection); } diff --git a/serial/main.c b/serial/main.c index 50dda095..39df1650 100644 --- a/serial/main.c +++ b/serial/main.c @@ -32,7 +32,7 @@ #include "plugin.h" #include "manager.h" -static DBusConnection *connection = NULL; +static DBusConnection *connection; static int serial_init(void) { @@ -51,6 +51,7 @@ static int serial_init(void) static void serial_exit(void) { serial_manager_exit(); + dbus_connection_unref(connection); } |