From 1b956c6ad74006b0bde400cadf4799e4162202da Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Fri, 23 Dec 2022 11:11:40 +0100 Subject: [PATCH] check log_buffer before expanding --- src/web/WebLogService.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/web/WebLogService.cpp b/src/web/WebLogService.cpp index 2e154d87b..146eaa2c1 100644 --- a/src/web/WebLogService.cpp +++ b/src/web/WebLogService.cpp @@ -78,6 +78,9 @@ size_t WebLogService::maximum_log_messages() const { } void WebLogService::maximum_log_messages(size_t count) { + if (count > maximum_log_messages_ && ESP.getMaxAllocHeap() < 41984) { + return; + } maximum_log_messages_ = std::max((size_t)1, count); while (log_messages_.size() > maximum_log_messages_) { log_messages_.pop_front();