From ac86fd481b749632421f57b9a2815779fe125e46 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Fri, 15 Sep 2023 18:21:47 +0100 Subject: [PATCH] [*] caught runtime regressions --- Source/Console/Commands/Commands.cpp | 2 +- Source/IO/Net/AuNetWorker.hpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/Console/Commands/Commands.cpp b/Source/Console/Commands/Commands.cpp index cf8edbac..633ca722 100644 --- a/Source/Console/Commands/Commands.cpp +++ b/Source/Console/Commands/Commands.cpp @@ -104,7 +104,7 @@ namespace Aurora::Console::Commands } else if (workerId) { - Async::NewWorkFunction(workerId.value(), [=]() -> void + Async::DispatchOn(workerId.value(), [=]() -> void { callback->OnCommand(res.result); }); diff --git a/Source/IO/Net/AuNetWorker.hpp b/Source/IO/Net/AuNetWorker.hpp index 2301f097..4a2c5218 100644 --- a/Source/IO/Net/AuNetWorker.hpp +++ b/Source/IO/Net/AuNetWorker.hpp @@ -74,19 +74,17 @@ namespace Aurora::IO::Net auto old = this->callbacks_; auto temp = AuMakeShared>([=](const AuSPtr &response) { - auto pWorkItem = this->origin_.pool->NewWorkFunction(this->origin_,[response, callbacks = old]() + (void)AuAsync::DispatchOn(this->origin_,[response, callbacks = old]() { callbacks->OnSuccess(response.get()); }); - SysAssert(pWorkItem->Dispatch(), "A network task failed to dispatch critically"); }, [=](const AuSPtr &response) { - auto pWorkItem = this->origin_.pool->NewWorkFunction(this->origin_, [response, callbacks = old]() + (void)AuAsync::DispatchOn(this->origin_, [response, callbacks = old]() { callbacks->OnFailure(response.get()); }); - SysAssert(pWorkItem->Dispatch(), "A network task failed to dispatch critically"); }); if (!temp)