diff --git a/doomsday/sdk/libcore/include/de/concurrency/async.h b/doomsday/sdk/libcore/include/de/concurrency/async.h index 30eaf6c631..0205d749de 100644 --- a/doomsday/sdk/libcore/include/de/concurrency/async.h +++ b/doomsday/sdk/libcore/include/de/concurrency/async.h @@ -72,9 +72,9 @@ class AsyncTaskThread : public AsyncTask } public: - AsyncTaskThread(Task const &task, Completion const &completion) - : task(task) - , completion(completion) + AsyncTaskThread(Task task, Completion completion) + : task(std::move(task)) + , completion(std::move(completion)) , valid(true) {} @@ -119,10 +119,10 @@ class AsyncTaskThread : public AsyncTask * callback has been called. You can pass this to AsyncScope for keeping track of. */ template -AsyncTask *async(Task const &task, Completion const &completion) +AsyncTask *async(Task task, Completion completion) { DENG2_ASSERT_IN_MAIN_THREAD(); - auto *t = new internal::AsyncTaskThread(task, completion); + auto *t = new internal::AsyncTaskThread(std::move(task), std::move(completion)); t->start(); // Note: The thread will delete itself when finished. return t;