Closed pablosun closed 6 years ago
I'll try to reproduce these 2 issues.
The BLE API, when calling advertiseAsBeacon, API clear old data with
But, I don't think this a good solution!!
@chengc843988 Thanks for the feedback, can you explain more on the clear()
usage issue?
There are several data members that get clear()
-ed:
std::vector<LBLEAdvDataItem> m_advDataList;
LBLEAdvDataItem
std::vector<bt_gatts_service_rec_t*> m_records;
Item 1 and 2 seems pretty safe to be clear()
-ed to me. We removes the element but keep the size of the vector, because we assume that the data size of advertisements are bounded by spec.
for item 3, it is true that the buffer pointed bybt_gatts_service_rec_t*
never gets released. We assume that all services are declared statically and never gets released.
Perhaps you meant some other bugs? Can you clarify more?
Many thanks for your help.
LINE: 1066 (LBLEPeriphral.cpp) // remove the advertisement data // so that advertiseAgain() won't succeed // until advertise() API is called again. LBLEAdvertisementData* ptr=m_pAdvData.release(); delete ptr;
https://zh.forum.labs.mediatek.com/t/7697-memory-leak/1382
2 memory leak cases are reported. This issue registers LBLE case. LWiFi case is registered as #100
Reproduce Steps
LBLE
Heap memory reduces when calling this repeatedly
repeatedly.