From 5343661069155883a4cf9ee901325e6d6e015918 Mon Sep 17 00:00:00 2001 From: Pk11 Date: Tue, 23 Mar 2021 04:20:52 -0500 Subject: [PATCH] Don't call downloadFailed() in queue mode That makes a waitMsg which starts a new frame... which is the same exact problem that caused the last "random" crashing xD Fixes #76 --- source/utils/scriptUtils.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/utils/scriptUtils.cpp b/source/utils/scriptUtils.cpp index cc4f3a6..2bdd896 100644 --- a/source/utils/scriptUtils.cpp +++ b/source/utils/scriptUtils.cpp @@ -182,12 +182,13 @@ Result ScriptUtils::downloadRelease(const std::string &repo, const std::string & } if (downloadFromRelease("https://github.com/" + repo, file, out, includePrereleases) != 0) { - if (isARG) showProgressBar = false; - - downloadFailed(); ret = FAILED_DOWNLOAD; if (isARG) { + showProgressBar = false; + + downloadFailed(); + threadJoin(thread, U64_MAX); threadFree(thread); } @@ -225,12 +226,13 @@ Result ScriptUtils::downloadFile(const std::string &file, const std::string &out } if (downloadToFile(file, out) != 0) { - if (isARG) showProgressBar = false; - - downloadFailed(); ret = FAILED_DOWNLOAD; if (isARG) { + showProgressBar = false; + + downloadFailed(); + threadJoin(thread, U64_MAX); threadFree(thread); }