summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hcid/device.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hcid/device.c b/hcid/device.c
index a098f873..49b3ab84 100644
--- a/hcid/device.c
+++ b/hcid/device.c
@@ -733,12 +733,12 @@ static void device_destroy(struct device *device)
void device_cleanup(void)
{
- g_slist_foreach(device_list, (GFunc) device_destroy, NULL);
- g_slist_free(device_list);
-
if (connection == NULL)
return;
+ g_slist_foreach(device_list, (GFunc) device_destroy, NULL);
+ g_slist_free(device_list);
+
dbus_connection_unref(connection);
}