Unverified Commit e831680a authored by ushiboy's avatar ushiboy Committed by GitHub

Fixed a memory leak in BLE (issue #4753) (#4761)

* Fixed crash on delete after disconnect

* Fixed memory leak when getting characteristics

* Removed guard
Co-authored-by: default avatarushiboy <ushiboy.dev@gmail.com>
parent d9648738
...@@ -60,6 +60,7 @@ BLEClient::~BLEClient() { ...@@ -60,6 +60,7 @@ BLEClient::~BLEClient() {
delete myPair.second; delete myPair.second;
} }
m_servicesMap.clear(); m_servicesMap.clear();
m_servicesMapByInstID.clear();
} // ~BLEClient } // ~BLEClient
......
...@@ -52,6 +52,7 @@ BLERemoteCharacteristic::BLERemoteCharacteristic( ...@@ -52,6 +52,7 @@ BLERemoteCharacteristic::BLERemoteCharacteristic(
*/ */
BLERemoteCharacteristic::~BLERemoteCharacteristic() { BLERemoteCharacteristic::~BLERemoteCharacteristic() {
removeDescriptors(); // Release resources for any descriptor information we may have allocated. removeDescriptors(); // Release resources for any descriptor information we may have allocated.
free(m_rawData);
} // ~BLERemoteCharacteristic } // ~BLERemoteCharacteristic
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment