From f8f0f4f616a698ffb9a300718f7ba272e8f28906 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Thu, 3 Sep 2020 15:11:14 +0200 Subject: [PATCH] Reduce memory usage of BackLog --- tasmota/support_command.ino | 2 +- tasmota/tasmota.ino | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index 379d15e0c..0cdba2969 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -323,7 +323,7 @@ void CmndBacklog(void) backlog.add(blcommand); } #else - backlog[backlog_index] = String(blcommand); + backlog[backlog_index] = blcommand; backlog_index++; if (backlog_index >= MAX_BACKLOG) backlog_index = 0; #endif diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index d257b6ddb..d3b3afd32 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -339,6 +339,7 @@ void BacklogLoop(void) { #else backlog_mutex = true; ExecuteCommand((char*)backlog[backlog_pointer].c_str(), SRC_BACKLOG); + backlog[backlog_pointer] = (const char*) nullptr; // force deallocation of the String internal memory backlog_pointer++; if (backlog_pointer >= MAX_BACKLOG) { backlog_pointer = 0; } backlog_mutex = false;