[iOS] Fix L2CAP crash issue.

PiperOrigin-RevId: 765077236
This commit is contained in:
Edwin Wu
2025-05-30 01:11:20 -07:00
committed by Copybara-Service
parent c50e619438
commit bbc56c10ec
4 changed files with 35 additions and 6 deletions
@@ -57,6 +57,11 @@ bool BleL2capServerSocket::AddPendingSocket(std::unique_ptr<BleL2capSocket> sock
return !closed_;
}
void BleL2capServerSocket::SetCloseNotifier(absl::AnyInvocable<void()> notifier) {
absl::MutexLock lock(&mutex_);
close_notifier_ = std::move(notifier);
}
Exception BleL2capServerSocket::Close() {
absl::MutexLock lock(&mutex_);
return DoClose();