mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 14:46:04 +02:00
Try fix crash when canceling download
This commit is contained in:
@@ -159,6 +159,8 @@ namespace VRCX
|
|||||||
public void CancelDownload()
|
public void CancelDownload()
|
||||||
{
|
{
|
||||||
DownloadCanceled = true;
|
DownloadCanceled = true;
|
||||||
|
try
|
||||||
|
{
|
||||||
if (client != null)
|
if (client != null)
|
||||||
{
|
{
|
||||||
client.CancelAsync();
|
client.CancelAsync();
|
||||||
@@ -171,6 +173,11 @@ namespace VRCX
|
|||||||
if (Directory.Exists(Path.Combine(AssetBundleCacherTemp, AssetId)))
|
if (Directory.Exists(Path.Combine(AssetBundleCacherTemp, AssetId)))
|
||||||
Directory.Delete(Path.Combine(AssetBundleCacherTemp, AssetId), true);
|
Directory.Delete(Path.Combine(AssetBundleCacherTemp, AssetId), true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch(Exception)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
DownloadProgress = -4;
|
DownloadProgress = -4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,7 +263,7 @@ namespace VRCX
|
|||||||
Directory.Delete(Path.Combine(AssetBundleCacherTemp, AssetId), true);
|
Directory.Delete(Path.Combine(AssetBundleCacherTemp, AssetId), true);
|
||||||
File.Delete(DownloadTempLocation);
|
File.Delete(DownloadTempLocation);
|
||||||
}
|
}
|
||||||
catch
|
catch(Exception)
|
||||||
{
|
{
|
||||||
DownloadProgress = -14;
|
DownloadProgress = -14;
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user