mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 07:06:11 -04:00
This fixes a crash when calling StopAdvertising
PiperOrigin-RevId: 408665191
This commit is contained in:
committed by
Copybara-Service
parent
dd237591f9
commit
9221d12ae1
@@ -179,9 +179,14 @@ void BluetoothServerSocket::InitializeServiceSdpAttributes(
|
||||
// Returns Exception::kIo on error, Exception::kSuccess otherwise.
|
||||
Exception BluetoothServerSocket::Close() {
|
||||
EnterCriticalSection(&critical_section_);
|
||||
if (closed_) {
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
return {Exception::kSuccess};
|
||||
}
|
||||
|
||||
rfcomm_provider_.StopAdvertising();
|
||||
closed_ = true;
|
||||
bluetooth_sockets_ = {};
|
||||
rfcomm_provider_.StopAdvertising();
|
||||
LeaveCriticalSection(&critical_section_);
|
||||
|
||||
return {Exception::kSuccess};
|
||||
|
||||
Reference in New Issue
Block a user