From 0e4fb34307ccb4ec78d5be7fd77eb24f2a3e7a8a Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 15 Jul 2013 14:29:54 +0300 Subject: [PATCH] core: Remove unnecessary btd_device reference count in browse_req The browse request is "owned" by the btd_device structure so it doesn't make sense to have browse_req keeping an extra reference for the btd_device. --- src/device.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/device.c b/src/device.c index f001502ef..a46ee0695 100644 --- a/src/device.c +++ b/src/device.c @@ -435,8 +435,6 @@ static void browse_request_free(struct browse_req *req) g_dbus_remove_watch(dbus_conn, req->listener_id); if (req->msg) dbus_message_unref(req->msg); - if (req->device) - btd_device_unref(req->device); g_slist_free_full(req->profiles_added, g_free); if (req->records) sdp_list_free(req->records, (sdp_free_func_t) sdp_record_free); @@ -3426,7 +3424,7 @@ static int device_browse_primary(struct btd_device *device, DBusMessage *msg) return -EBUSY; req = g_new0(struct browse_req, 1); - req->device = btd_device_ref(device); + req->device = device; device->browse = req; @@ -3485,7 +3483,7 @@ static int device_browse_sdp(struct btd_device *device, DBusMessage *msg) return -EBUSY; req = g_new0(struct browse_req, 1); - req->device = btd_device_ref(device); + req->device = device; sdp_uuid16_create(&uuid, uuid_list[req->search_uuid++]); err = bt_search_service(adapter_get_address(adapter), &device->bdaddr, -- 2.47.3