Skip to content

Fix iOS crash when starting a scan while another scan is running - #947

Open
uveshm003 wants to merge 1 commit into
PhilipsHue:masterfrom
uveshm003:fix/ios-scan-assert-838
Open

uveshm003 wants to merge 1 commit into
PhilipsHue:masterfrom
uveshm003:fix/ios-scan-assert-838

Conversation

@uveshm003

Copy link
Copy Markdown

Fixes #838

scanForDevices on iOS used assert(!central.isScanning), which crashes debug builds when a new scan is requested while one is still active (e.g. during the prescan of connectToAdvertisingDevice). This change stops the ongoing scan before preparing the new one, matching the Android behaviour where ScanDevicesHandler.prepareScan calls stopDeviceScan().

Verified the example app builds for iOS.

…Hue#838)

Starting a new scan while another one is running (e.g. the prescan of
connectToAdvertisingDevice) triggered assert(!central.isScanning) and
crashed debug builds. Stop the ongoing scan first, matching the Android
implementation where ScanDevicesHandler.prepareScan calls stopDeviceScan().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scanForDevices should not use 'assert(!central.isScanning)'

1 participant