[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:
J. Nick Koston
2026-03-08 00:15:30 -10:00
parent 982998c8fb
commit 09c0915d0c
+2 -7
View File
@@ -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_();