From 18bec3e323fe4eb92429ee0ba2b7190a9bbb8ebb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 4 Jan 2013 11:06:41 -0800 Subject: [PATCH] core: Cancel all pending commands for the index on adapter removal --- src/adapter.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index 5a30fc01c..f65b901a1 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -1960,6 +1960,12 @@ static void adapter_free(gpointer user_data) */ mgmt_unregister_index(adapter->mgmt, adapter->dev_id); + /* + * Cancel all pending commands for this specific index + * since the adapter bound to them is no longer valid. + */ + mgmt_cancel_index(adapter->mgmt, adapter->dev_id); + mgmt_unref(adapter->mgmt); sdp_list_free(adapter->services, NULL); -- 2.47.3