From 333650938a1282cf82fc340a6f92795d0eb574a8 Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Sun, 7 Apr 2024 06:50:02 +0000 Subject: [PATCH] fix dispatcher --- src/sled/experimental/design_patterns/dispatcher.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sled/experimental/design_patterns/dispatcher.h b/src/sled/experimental/design_patterns/dispatcher.h index 1c49444..a2eb112 100644 --- a/src/sled/experimental/design_patterns/dispatcher.h +++ b/src/sled/experimental/design_patterns/dispatcher.h @@ -44,7 +44,10 @@ public: // sled::MutexLock lock(&mutex_); sled::SharedMutexReadLock lock(&rwlock_); for (auto &handler : handlers_) { - if (handler->HandleMessage(message)) { return DispatchResult::kHandled; } + if (handler->HandleMessage(message)) { + handler->OnMessage(message); + return DispatchResult::kHandled; + } } return DispatchResult::kNotFound; }