From 0e8d4c60bc76653a01dd4fe0aa07b3e9847b5aff Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:37:22 -0300 Subject: [PATCH] fix nest issue --- loader/src/loader/LoaderImpl.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/loader/src/loader/LoaderImpl.cpp b/loader/src/loader/LoaderImpl.cpp index c780221f4..bc855f778 100644 --- a/loader/src/loader/LoaderImpl.cpp +++ b/loader/src/loader/LoaderImpl.cpp @@ -505,20 +505,20 @@ void Loader::Impl::loadModGraph(Mod* node, bool early) { thread::setName("Mod Unzip"); log::loadNest(nest); auto res = unzipFunction(); - auto prevNest = log::saveNest(); - log::loadNest(nest); - if (!res) { - this->addProblem({ - LoadProblem::Type::UnzipFailed, - node, - res.unwrapErr() - }); - log::error("Failed to unzip: {}", res.unwrapErr()); - m_refreshingModCount -= 1; - log::loadNest(prevNest); - return; - } - this->queueInMainThread([=, this]() { + this->queueInMainThread([=, this, res = std::move(res)]() { + auto prevNest = log::saveNest(); + log::loadNest(nest); + if (!res) { + this->addProblem({ + LoadProblem::Type::UnzipFailed, + node, + res.unwrapErr() + }); + log::error("Failed to unzip: {}", res.unwrapErr()); + m_refreshingModCount -= 1; + log::loadNest(prevNest); + return; + } loadFunction(); log::loadNest(prevNest); });