OpenBluetoothToolbox / SimpleBLE

SimpleBLE - the all-in-one Bluetooth library for MacOS, iOS, Windows, Linux and Android.
https://www.simpleble.org
Other
619 stars 107 forks source link

Crash when unplug bluetooth adapter after it's connected to a device #272

Open squarepantsspongebob opened 8 months ago

squarepantsspongebob commented 8 months ago

After unplug bluetooth adapter, the code will run into the bool PeripheralBase::_attemp_connect() function. However, the pointer device_ could be an empty pointer which leads to crash.

I've tryed to add logic below and can fix the bug. if ( nullptr == device_ ) { return false; }