forked from h2zero/esp-nimble-cpp
Add clearAll parameter to deinit() (#22)
* Add clearAll parameter to deinit() Adds the ability to clear all resources consumed during BLE operation when deinitializing and shutting down BLE. Useful when BLE is used intermittently or in a task that initializes, performs operations then deinitializes. By setting the clearAll parameter to true all created BLE objects will be deleted, freeing the memory for other tasks. Warning: This will invalidate any pointers that may be referencing the deleted objects. * Add bool deleteCallbacks parameter to NimBLEServer::setCallbacks, if true (default) will delete the callback class when server is destructed. * Delete scan results when scan is destructed.
This commit is contained in:
@@ -44,6 +44,13 @@ NimBLEScan::NimBLEScan() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Scan destructor, release any allocated resources.
|
||||
*/
|
||||
NimBLEScan::~NimBLEScan() {
|
||||
clearResults();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Handle GAP events related to scans.
|
||||
* @param [in] event The event type for this event.
|
||||
|
||||
Reference in New Issue
Block a user