From 8332abd8fe8cfb88aa323b315eb228f0d0f581ff Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 20 Jan 2013 15:31:17 -0800 Subject: [PATCH] core: Remove pointless protection for device path at unregister If such a protection is really needed, then it might should be better handled properly within GDBus. So remove it and if it causes an issue, fix it then. --- src/device.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/device.c b/src/device.c index 63621304d..e1219c4bb 100644 --- a/src/device.c +++ b/src/device.c @@ -3990,8 +3990,6 @@ struct btd_device *btd_device_ref(struct btd_device *device) void btd_device_unref(struct btd_device *device) { - char *path; - device->ref--; DBG("%p: ref=%d", device, device->ref); @@ -3999,11 +3997,7 @@ void btd_device_unref(struct btd_device *device) if (device->ref > 0) return; - path = g_strdup(device->path); - - g_dbus_unregister_interface(dbus_conn, path, DEVICE_INTERFACE); - - g_free(path); + g_dbus_unregister_interface(dbus_conn, device->path, DEVICE_INTERFACE); } int device_get_appearance(struct btd_device *device, uint16_t *value) -- 2.47.3