From 6de84b474ef16843ef7a64ea1731e14c4c95bdb4 Mon Sep 17 00:00:00 2001 From: Reece Date: Wed, 30 Jun 2021 10:35:53 +0100 Subject: [PATCH] [*] BasicWorkStdFunc wrapper -> rename 'shutdown' property, made shutdown property optional --- Include/Aurora/Async/Async.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Include/Aurora/Async/Async.hpp b/Include/Aurora/Async/Async.hpp index 49f9a5b4..dc37a588 100644 --- a/Include/Aurora/Async/Async.hpp +++ b/Include/Aurora/Async/Async.hpp @@ -98,9 +98,9 @@ namespace Aurora::Async struct BasicWorkStdFunc : IWorkItemHandler { std::function callback; - std::function error; + std::function shutdown; - BasicWorkStdFunc(std::function &&callback, std::function &&error) : callback(std::move(callback)), error(std::move(error)) + BasicWorkStdFunc(std::function &&callback, std::function &&error) : callback(std::move(callback)), shutdown(std::move(shutdown)) {} BasicWorkStdFunc(std::function &&callback) : callback(std::move(callback)) @@ -109,7 +109,7 @@ namespace Aurora::Async BasicWorkStdFunc(const std::function &callback) : callback(callback) {} - BasicWorkStdFunc(const std::function &callback, const std::function &error) : callback(callback), error(error) + BasicWorkStdFunc(const std::function &callback, const std::function &shutdown) : callback(callback), shutdown(shutdown) {} private: @@ -130,7 +130,10 @@ namespace Aurora::Async { try { - error(); + if (shutdown) + { + shutdown(); + } } catch (...) {