diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2008-09-04 15:53:06 -0300 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2008-09-05 16:08:30 -0300 |
commit | 6299ff3c17ae5d77165edd147ee20495947a549e (patch) | |
tree | 73f65a785ed6191585a4eef0e59fa0192ad934d8 /network | |
parent | 9ab6fa037c8c3e72ad0c789c379d3310eafc225f (diff) |
Network: Missing DBusConnection unref
Diffstat (limited to 'network')
-rw-r--r-- | network/main.c | 12 |
1 files changed, 7 insertions, 5 deletions
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) |