Skip to content

Commit b93492a

Browse files
committed
[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.
1 parent 9987747 commit b93492a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/NimBLEScan.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ NimBLEScan::NimBLEScan()
4141
* @brief Scan destructor, release any allocated resources.
4242
*/
4343
NimBLEScan::~NimBLEScan() {
44-
clearResults();
44+
for (const auto& dev : m_scanResults.m_deviceVec) {
45+
delete dev;
46+
}
4547
}
4648

4749
/**

0 commit comments

Comments
 (0)