From 8635ca4d36ffaa3289f63c2eee4921e534f8e820 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 10 May 2023 23:43:19 -0400 Subject: [PATCH] Make sure to not mutate a dictionary while we're enumerating it. (#26493) --- src/platform/Darwin/BleConnectionDelegateImpl.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/Darwin/BleConnectionDelegateImpl.mm b/src/platform/Darwin/BleConnectionDelegateImpl.mm index 5afd14fcb89199..ad1093007473bb 100644 --- a/src/platform/Darwin/BleConnectionDelegateImpl.mm +++ b/src/platform/Darwin/BleConnectionDelegateImpl.mm @@ -698,7 +698,7 @@ - (void)removePeripheralFromCache:(CBPeripheral *)peripheral - (void)removePeripheralsFromCache { - for (CBPeripheral * peripheral in _cachedPeripherals) { + for (CBPeripheral * peripheral in [_cachedPeripherals allValues]) { [self removePeripheralFromCache:peripheral]; } }