diff --git a/src/MPDevice.cpp b/src/MPDevice.cpp index 2012d4b2..7aaa09c8 100755 --- a/src/MPDevice.cpp +++ b/src/MPDevice.cpp @@ -8606,6 +8606,12 @@ void MPDevice::lockDevice(const MessageHandlerCb &cb) const auto afterFn = [](const QByteArray &, bool &) -> bool { return true; }; jobs->append(new MPCommandJob(this, MPCmd::LOCK_DEVICE, afterFn)); + connect(jobs, &AsyncJobs::finished, [cb](const QByteArray &) + { + qInfo() << "Lock device was successful."; + cb(true, ""); + }); + connect(jobs, &AsyncJobs::failed, [cb](AsyncJob *failedJob) { Q_UNUSED(failedJob); @@ -8613,12 +8619,6 @@ void MPDevice::lockDevice(const MessageHandlerCb &cb) cb(false, {}); }); - connect(jobs, &AsyncJobs::finished, [cb](const QByteArray &) - { - qInfo() << "Lock device was successful."; - cb(true, ""); - }); - jobsQueue.enqueue(jobs); runAndDequeueJobs(); }