This commit is contained in:
J. Nick Koston 2025-07-06 18:27:49 -05:00
parent 2dc222aea6
commit f395767766
No known key found for this signature in database

View File

@ -436,15 +436,17 @@ bool HOT Scheduler::cancel_item_locked_(Component *component, const char *name_c
// Check all containers for matching items
#if !defined(USE_ESP8266) && !defined(USE_RP2040)
// Cancel items in defer queue
for (auto &item : this->defer_queue_) {
if (item->component != component || item->type != type || item->remove) {
continue;
}
const char *item_name = item->get_name();
if (item_name != nullptr && strcmp(name_cstr, item_name) == 0) {
item->remove = true;
total_cancelled++;
// Only check defer queue for timeouts (intervals never go there)
if (type == SchedulerItem::TIMEOUT) {
for (auto &item : this->defer_queue_) {
if (item->component != component || item->remove) {
continue;
}
const char *item_name = item->get_name();
if (item_name != nullptr && strcmp(name_cstr, item_name) == 0) {
item->remove = true;
total_cancelled++;
}
}
}
#endif