[WARN] NTPClient memory leak — never deleted #5
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
NetManager::NetManager()createsNTPClient* _ntp = new NTPClient(...)but never deletes it.For long-running devices this causes a memory leak on restart.
Affected file:
libraries/KlubhausCore/src/NetManager.cppline ~39Fix
Add destructor:
~NetManager() { delete _ntp; }or use stack allocation.