Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5e46722 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "SM: Reset fixed channel service pointer so we could continue"

parents 3c9275a2 51c98cd8
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -57,6 +57,7 @@ SecurityManagerChannel::~SecurityManagerChannel() {
  if (fixed_channel_service_ != nullptr) {
  if (fixed_channel_service_ != nullptr) {
    fixed_channel_service_->Unregister(common::Bind(&SecurityManagerChannel::OnUnregistered, common::Unretained(this)),
    fixed_channel_service_->Unregister(common::Bind(&SecurityManagerChannel::OnUnregistered, common::Unretained(this)),
                                       handler_);
                                       handler_);
    fixed_channel_service_.reset();
  }
  }
}
}


@@ -132,7 +133,6 @@ void SecurityManagerChannel::OnConnectionFail(hci::Address address,
            result.connection_result_code);
            result.connection_result_code);
  auto entry = fixed_channel_map_.find(address);
  auto entry = fixed_channel_map_.find(address);
  if (entry != fixed_channel_map_.end()) {
  if (entry != fixed_channel_map_.end()) {
    entry->second->Release();
    entry->second.reset();
    entry->second.reset();
    fixed_channel_map_.erase(entry);
    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());
  LOG_ERROR("Connection closed due to: %s", hci::ErrorCodeText(error_code).c_str());
  auto entry = fixed_channel_map_.find(address);
  auto entry = fixed_channel_map_.find(address);
  if (entry != fixed_channel_map_.end()) {
  if (entry != fixed_channel_map_.end()) {
    entry->second->Release();
    entry->second.reset();
    entry->second.reset();
    fixed_channel_map_.erase(entry);
    fixed_channel_map_.erase(entry);
  }
  }