diff --git a/lib/base/io-engine.hpp b/lib/base/io-engine.hpp index 2d2c5e922..64831ff8c 100644 --- a/lib/base/io-engine.hpp +++ b/lib/base/io-engine.hpp @@ -105,7 +105,7 @@ public: template static void SpawnCoroutine(Handler& h, Function f) { - auto wrapper = [f](boost::asio::yield_context yc) { + auto wrapper = [f = std::move(f)](boost::asio::yield_context yc) { try { f(yc); } catch (const std::exception& ex) {