diff --git a/include/mbgl/actor/scheduler.hpp b/include/mbgl/actor/scheduler.hpp index ee87f872ccd..00926287026 100644 --- a/include/mbgl/actor/scheduler.hpp +++ b/include/mbgl/actor/scheduler.hpp @@ -61,9 +61,9 @@ class Scheduler { /// the given closure to this scheduler, the consequent calls of the /// returned closure are ignored. /// - /// If this scheduler is already deleted by the time the returnded closure + /// If this scheduler is already deleted by the time the returned closure /// is first invoked, the call is ignored. - Scheduler::Task bindOnce(Task); + Scheduler::Task bindOnce(Task&&); /// Enqueues the given |task| for execution into this scheduler's task queue /// and then enqueues the |reply| with the captured task result to the diff --git a/src/mbgl/actor/scheduler.cpp b/src/mbgl/actor/scheduler.cpp index 4e15a2b38ff..136f762cab4 100644 --- a/src/mbgl/actor/scheduler.cpp +++ b/src/mbgl/actor/scheduler.cpp @@ -5,7 +5,7 @@ namespace mbgl { -Scheduler::Task Scheduler::bindOnce(Scheduler::Task fn) { +Scheduler::Task Scheduler::bindOnce(Scheduler::Task&& fn) { assert(fn); return [scheduler = makeWeakPtr(), scheduled = std::move(fn)]() mutable { if (!scheduled) return; // Repeated call.