[Bugfix] NimBLEScan delete.

Calling NimBLEDevice::deint with the `clearAll` parameter set to `true` will delete the scan and any scan results but it was calling `clearall` which uses critical sections, this could cause a crash because the stack has already been de-initialized.
This commit is contained in:
h2zero
2025-06-08 16:43:56 -06:00
parent 20349d9e8b
commit e4d202f1ce

View File

@ -41,7 +41,9 @@ NimBLEScan::NimBLEScan()
* @brief Scan destructor, release any allocated resources. * @brief Scan destructor, release any allocated resources.
*/ */
NimBLEScan::~NimBLEScan() { NimBLEScan::~NimBLEScan() {
clearResults(); for (const auto& dev : m_scanResults.m_deviceVec) {
delete dev;
}
} }
/** /**