fixed crash on atlauncher pack install
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
8f5bb982cd
commit
c22eec8f27
@ -1005,15 +1005,30 @@ static Meta::Version::Ptr getComponentVersion(const QString& uid, const QString&
|
|||||||
if (!vlist)
|
if (!vlist)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
if (!vlist->isLoaded())
|
if (!vlist->isLoaded()) {
|
||||||
vlist->load(Net::Mode::Online);
|
QEventLoop loadVersionLoop;
|
||||||
|
auto task = vlist->getLoadTask();
|
||||||
|
QObject::connect(task.get(), &Task::finished, &loadVersionLoop, &QEventLoop::quit);
|
||||||
|
if (!task->isRunning())
|
||||||
|
task->start();
|
||||||
|
|
||||||
|
loadVersionLoop.exec();
|
||||||
|
}
|
||||||
|
|
||||||
auto ver = vlist->getVersion(version);
|
auto ver = vlist->getVersion(version);
|
||||||
if (!ver)
|
if (!ver)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
if (!ver->isLoaded())
|
if (!ver->isLoaded()) {
|
||||||
|
QEventLoop loadVersionLoop;
|
||||||
ver->load(Net::Mode::Online);
|
ver->load(Net::Mode::Online);
|
||||||
|
auto task = ver->getCurrentTask();
|
||||||
|
QObject::connect(task.get(), &Task::finished, &loadVersionLoop, &QEventLoop::quit);
|
||||||
|
if (!task->isRunning())
|
||||||
|
task->start();
|
||||||
|
|
||||||
|
loadVersionLoop.exec();
|
||||||
|
}
|
||||||
|
|
||||||
return ver;
|
return ver;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user