Use CancellationFlagListener to ensure that Accept exits.

This commit is contained in:
Vibhav Pant
2023-09-02 22:04:07 +05:30
parent be0379a3de
commit e95710907f
3 changed files with 23 additions and 5 deletions
@@ -31,7 +31,7 @@ std::unique_ptr<api::BluetoothSocket> BluetoothServerSocket::Accept() {
<< ": accepting new connections for service uuid "
<< service_uuid_;
auto pair = profile_manager_.GetServiceRecordFD(service_uuid_, stopped_);
auto pair = profile_manager_.GetServiceRecordFD(service_uuid_, &stopped_);
if (!pair.has_value()) {
NEARBY_LOGS(ERROR) << __func__
<< "Failed to get a new connection for profile "