diff --git a/src/platform/Darwin/BleConnectionDelegateImpl.mm b/src/platform/Darwin/BleConnectionDelegateImpl.mm index 9f05bb65edae16..ab8242ea649060 100644 --- a/src/platform/Darwin/BleConnectionDelegateImpl.mm +++ b/src/platform/Darwin/BleConnectionDelegateImpl.mm @@ -91,10 +91,13 @@ - (BOOL)isConnecting; dispatch_queue_t bleWorkQueue; void BleConnectionDelegateImpl::NewConnection( - Ble::BleLayer * bleLayer, void * appState, const SetupDiscriminator & deviceDiscriminator) + Ble::BleLayer * bleLayer, void * appState, const SetupDiscriminator & inDeviceDiscriminator) { assertChipStackLockedByCurrentThread(); + // Make a copy of the device discriminator for the block to capture. + SetupDiscriminator deviceDiscriminator = inDeviceDiscriminator; + ChipLogProgress(Ble, "%s", __FUNCTION__); if (!bleWorkQueue) { bleWorkQueue = dispatch_queue_create(kBleWorkQueueName, DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL);