mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 18:52:30 +00:00
BT sleep leak now down to about 200 bytes
This commit is contained in:
@@ -224,6 +224,14 @@ void deinitBLE()
|
||||
{
|
||||
assert(pServer);
|
||||
|
||||
pServer->getAdvertising()->stop();
|
||||
|
||||
destroyUpdateService();
|
||||
|
||||
pUpdate->stop();
|
||||
pDevInfo->stop();
|
||||
pUpdate->stop(); // we delete them below
|
||||
|
||||
// First shutdown bluetooth
|
||||
BLEDevice::deinit(false);
|
||||
|
||||
@@ -235,7 +243,6 @@ void deinitBLE()
|
||||
delete pServer;
|
||||
|
||||
batteryLevelC = NULL; // Don't let anyone generate bogus notifies
|
||||
destroyUpdateService();
|
||||
|
||||
for (int i = 0; i < numChars; i++)
|
||||
delete chars[i];
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "SimpleAllocator.h"
|
||||
#include "assert.h"
|
||||
|
||||
SimpleAllocator *activeAllocator;
|
||||
|
||||
SimpleAllocator::SimpleAllocator() { reset(); }
|
||||
|
||||
@@ -22,6 +21,11 @@ void *operator new(size_t size, SimpleAllocator &p)
|
||||
return p.alloc(size);
|
||||
}
|
||||
|
||||
#if 0
|
||||
// This was a dumb idea, turn off for now
|
||||
|
||||
SimpleAllocator *activeAllocator;
|
||||
|
||||
AllocatorScope::AllocatorScope(SimpleAllocator &a)
|
||||
{
|
||||
assert(!activeAllocator);
|
||||
@@ -51,4 +55,6 @@ void operator delete(void *ptr) throw()
|
||||
Serial.println("Warning: leaking an active allocator object"); // We don't properly handle this yet
|
||||
else
|
||||
free(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user