manolofdez / AsyncBluetooth

A small library that adds concurrency to CoreBluetooth APIs.
MIT License
160 stars 30 forks source link

[Bugfix] Avoid crash when cancelling operations while scanning #36

Closed manolofdez closed 11 months ago

manolofdez commented 11 months ago

scanForPeripherals will resume with an async stream, but the enqueue call stays awaiting until the stream terminates. Which opens it up for reuse, causing a crash. We need to revisit this strategy. For now, this workaround will avoid the crash.