Fix crash when canceling

This commit is contained in:
Kawe Mazidjatari 2023-07-28 15:45:44 +02:00
parent 682e7d8847
commit bc5e4feabe

View File

@ -258,6 +258,9 @@ void BeginInstall(CDownloadProgress* pProgress, const bool bPrerelease, const bo
}
DownloadAssetList(pProgress, manifest, blackList, DEFAULT_DEPOT_DOWNLOAD_DIR);
if (pProgress->IsCanceled())
return;
// Download SDK files.
if (!DownloadLatestGitHubReleaseManifest(XorStr("https://api.github.com/repos/Mauler125/r5sdk/releases"), responseMesage, manifest, bPrerelease))
{
@ -266,6 +269,9 @@ void BeginInstall(CDownloadProgress* pProgress, const bool bPrerelease, const bo
}
DownloadAssetList(pProgress, manifest, blackList, DEFAULT_DEPOT_DOWNLOAD_DIR);
if (pProgress->IsCanceled())
return;
// Install process cannot be canceled.
pProgress->SetCanCancel(false);
@ -303,7 +309,7 @@ void CBaseSurface::OnInstallClick(Forms::Control* Sender)
Threading::Thread([pProgress] {
BeginInstall(pProgress);
BeginInstall(pProgress, false, false);
}).Start();