improve robustness when heap is low

* customMappingTable: allocate using calloc instead of new (new will throw exception if nor enough heap)
* fixing a few minor memory leaks
* ws.cpp: catch out-of-memory in sendLiveLedsWs
* ws.cpp: change interval to 80ms (120 ws very slow...)
This commit is contained in:
Frank
2023-05-15 21:15:24 +02:00
parent 9f6278ae8a
commit 6d23eb6874
6 changed files with 49 additions and 16 deletions

View File

@@ -8,7 +8,7 @@
//#define WLED_DEBUG_NTP
#define NTP_SYNC_INTERVAL 42000UL //Get fresh NTP time about twice per day
Timezone* tz;
Timezone* tz = nullptr;
#define TZ_UTC 0
#define TZ_UK 1
@@ -38,7 +38,7 @@ Timezone* tz;
byte tzCurrent = TZ_INIT; //uninitialized
void updateTimezone() {
delete tz;
if (tz) {delete tz; tz = nullptr;}
TimeChangeRule tcrDaylight = {Last, Sun, Mar, 1, 0}; //UTC
TimeChangeRule tcrStandard = tcrDaylight; //UTC