From 6299ff3c17ae5d77165edd147ee20495947a549e Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Thu, 4 Sep 2008 15:53:06 -0300 Subject: Network: Missing DBusConnection unref --- network/main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'network') diff --git a/network/main.c b/network/main.c index 6efdb81d..2307a165 100644 --- a/network/main.c +++ b/network/main.c @@ -32,16 +32,17 @@ #include "plugin.h" #include "manager.h" +static DBusConnection *connection = NULL; + static int network_init(void) { - 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; - if (network_manager_init(conn) < 0) { - dbus_connection_unref(conn); + if (network_manager_init(connection) < 0) { + dbus_connection_unref(connection); return -EIO; } @@ -51,6 +52,7 @@ static int network_init(void) static void network_exit(void) { network_manager_exit(); + dbus_connection_unref(connection); } BLUETOOTH_PLUGIN_DEFINE("network", network_init, network_exit) -- cgit