From 46495995929f7a2d06a260d68685ee9e6a35d48d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 4 Jul 2025 10:01:00 -0500 Subject: [PATCH] fixes --- esphome/core/scheduler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/esphome/core/scheduler.cpp b/esphome/core/scheduler.cpp index 285354b262..2086f5e3dd 100644 --- a/esphome/core/scheduler.cpp +++ b/esphome/core/scheduler.cpp @@ -226,9 +226,10 @@ void HOT Scheduler::call() { // - No deferred items exist in to_add_, so processing order doesn't affect correctness while (!this->defer_queue_.empty()) { this->lock_.lock(); - if (this->defer_queue_.empty()) // Double-check with lock held + if (this->defer_queue_.empty()) { // Double-check with lock held this->lock_.unlock(); - break; + break; + } auto item = std::move(this->defer_queue_.front()); this->defer_queue_.pop_front(); this->lock_.unlock();