mirror of
https://github.com/esphome/esphome.git
synced 2026-09-23 13:08:41 +00:00
[scheduler] Remove redundant callback clear in delete_item_
The destructor of std::function already handles releasing captured resources — no need to explicitly null it before delete.
This commit is contained in:
@@ -353,13 +353,8 @@ class Scheduler {
|
||||
// IMPORTANT: Caller must hold the scheduler lock before calling this function.
|
||||
void recycle_item_main_loop_(SchedulerItem *item);
|
||||
|
||||
// Helper to delete a SchedulerItem (clears callback then frees memory)
|
||||
static void delete_item_(SchedulerItem *item) {
|
||||
if (item != nullptr) {
|
||||
item->callback = nullptr;
|
||||
delete item;
|
||||
}
|
||||
}
|
||||
// Helper to delete a SchedulerItem
|
||||
static void delete_item_(SchedulerItem *item) { delete item; }
|
||||
|
||||
// Helper to perform full cleanup when too many items are cancelled
|
||||
void full_cleanup_removed_items_();
|
||||
|
||||
Reference in New Issue
Block a user