From 46baaf0b8f47c466feffe3a0c18e917643245626 Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Mon, 18 Mar 2024 23:08:10 +0800 Subject: [PATCH] fix new timer crash --- src/timer/task_queue_timeout.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/timer/task_queue_timeout.cc b/src/timer/task_queue_timeout.cc index cb6b640..378b3f8 100644 --- a/src/timer/task_queue_timeout.cc +++ b/src/timer/task_queue_timeout.cc @@ -29,7 +29,9 @@ TaskQueueTimeoutFactory::TaskQueueTimeout::Start(DurationMs duration_ms, Timeout parent_.task_queue_.PostDelayedTaskWithPrecision( precision_, [timeout_id, this]() { + if (timeout_id != this->timeout_id_) { return; } LOGV("timer", "Timeout expired: {}", timeout_id); + ASSERT(posted_task_expiration_ != std::numeric_limits::max(), ""); posted_task_expiration_ = std::numeric_limits::max();