From 928939cbe3b55a39f3a29926514f1dbd989936a4 Mon Sep 17 00:00:00 2001 From: flow Date: Sun, 4 Dec 2022 12:29:38 -0300 Subject: [PATCH] fix(Inst.Copy): create FS::copy object inside the secundary thread Signed-off-by: flow --- launcher/InstanceCopyTask.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/launcher/InstanceCopyTask.cpp b/launcher/InstanceCopyTask.cpp index 0a83ed9c..188d163b 100644 --- a/launcher/InstanceCopyTask.cpp +++ b/launcher/InstanceCopyTask.cpp @@ -25,10 +25,10 @@ void InstanceCopyTask::executeTask() { setStatus(tr("Copying instance %1").arg(m_origInstance->name())); - FS::copy folderCopy(m_origInstance->instanceRoot(), m_stagingPath); - folderCopy.followSymlinks(false).matcher(m_matcher.get()); + m_copyFuture = QtConcurrent::run(QThreadPool::globalInstance(), [this]{ + FS::copy folderCopy(m_origInstance->instanceRoot(), m_stagingPath); + folderCopy.followSymlinks(false).matcher(m_matcher.get()); - m_copyFuture = QtConcurrent::run(QThreadPool::globalInstance(), [&folderCopy]{ return folderCopy(); }); connect(&m_copyFutureWatcher, &QFutureWatcher::finished, this, &InstanceCopyTask::copyFinished);