diff --git a/src/uvw/check.hpp b/src/uvw/check.hpp index 7b2ee5d7..61cf0535 100644 --- a/src/uvw/check.hpp +++ b/src/uvw/check.hpp @@ -31,7 +31,7 @@ public: } void start(Callback cb) noexcept { - callback = cb; + callback = std::move(cb); get()->data = this; auto err = uv_check_start(get(), &proto); diff --git a/src/uvw/resource.hpp b/src/uvw/resource.hpp index dbe6e977..a499986b 100644 --- a/src/uvw/resource.hpp +++ b/src/uvw/resource.hpp @@ -62,7 +62,7 @@ public: using Callback = std::function; void close(Callback cb) noexcept { - callback = cb; + callback = std::move(cb); get()->data = this; uv_close(get(), &proto); } diff --git a/src/uvw/stream.hpp b/src/uvw/stream.hpp index cf6a46b8..01b11648 100644 --- a/src/uvw/stream.hpp +++ b/src/uvw/stream.hpp @@ -42,7 +42,7 @@ public: // TODO shutdown void listen(int backlog, CallbackListen cb) noexcept { - listenCallback = cb; + listenCallback = std::move(cb); this->template get()->data = this; auto err = uv_listen(this->template get(), backlog, &protoListen); diff --git a/src/uvw/timer.hpp b/src/uvw/timer.hpp index 846ca670..77cac182 100644 --- a/src/uvw/timer.hpp +++ b/src/uvw/timer.hpp @@ -34,7 +34,7 @@ public: } void start(const Time &timeout, const Time &rep, Callback cb) noexcept { - callback = cb; + callback = std::move(cb); get()->data = this; auto err = uv_timer_start(get(), &proto, timeout.count(), rep.count());