From 27fabbac31f84016b4fe3fea7e3cf86069d4ac0b Mon Sep 17 00:00:00 2001 From: Martin Brabham Date: Tue, 10 Mar 2020 19:36:07 -0700 Subject: [PATCH] SM: Reset fixed channel service pointer so we could continue Bug: Test: bluetooth_test_gd Change-Id: I326ee8f8206d139fadb4585a47832e2a0416dd4a --- gd/security/channel/security_manager_channel.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gd/security/channel/security_manager_channel.cc b/gd/security/channel/security_manager_channel.cc index 81bdda16c..c07446c5b 100644 --- a/gd/security/channel/security_manager_channel.cc +++ b/gd/security/channel/security_manager_channel.cc @@ -57,6 +57,7 @@ SecurityManagerChannel::~SecurityManagerChannel() { if (fixed_channel_service_ != nullptr) { fixed_channel_service_->Unregister(common::Bind(&SecurityManagerChannel::OnUnregistered, common::Unretained(this)), handler_); + fixed_channel_service_.reset(); } } @@ -132,7 +133,6 @@ void SecurityManagerChannel::OnConnectionFail(hci::Address address, result.connection_result_code); auto entry = fixed_channel_map_.find(address); if (entry != fixed_channel_map_.end()) { - entry->second->Release(); entry->second.reset(); fixed_channel_map_.erase(entry); } @@ -144,7 +144,6 @@ void SecurityManagerChannel::OnConnectionClose(hci::Address address, hci::ErrorC LOG_ERROR("Connection closed due to: %s", hci::ErrorCodeText(error_code).c_str()); auto entry = fixed_channel_map_.find(address); if (entry != fixed_channel_map_.end()) { - entry->second->Release(); entry->second.reset(); fixed_channel_map_.erase(entry); } -- 2.11.0