From a3a57181a6de8878e392a82435f03c3f18f48755 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 29 Oct 2020 02:59:10 +1100 Subject: [PATCH] re-copy list when waiting since it may have changed --- app/render/previewautocacher.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/render/previewautocacher.cpp b/app/render/previewautocacher.cpp index 030c94e48..66973aa7c 100644 --- a/app/render/previewautocacher.cpp +++ b/app/render/previewautocacher.cpp @@ -327,6 +327,7 @@ void PreviewAutoCacher::ClearHashQueue(bool wait) (*it)->cancel(); } if (wait) { + copy = hash_tasks_; for (auto it=copy.cbegin(); it!=copy.cend(); it++) { (*it)->waitForFinished(); } @@ -342,6 +343,7 @@ void PreviewAutoCacher::ClearVideoQueue(bool wait) it.key()->Cancel(); } if (wait) { + copy = video_tasks_; for (auto it=copy.cbegin(); it!=copy.cend(); it++) { it.key()->WaitForFinished(); } @@ -360,6 +362,7 @@ void PreviewAutoCacher::ClearAudioQueue(bool wait) it.key()->Cancel(); } if (wait) { + copy = audio_tasks_; for (auto it=copy.cbegin(); it!=copy.cend(); it++) { it.key()->WaitForFinished(); } @@ -375,6 +378,7 @@ void PreviewAutoCacher::ClearVideoDownloadQueue(bool wait) it.key()->cancel(); } if (wait) { + copy = video_download_tasks_; for (auto it=copy.cbegin(); it!=copy.cend(); it++) { it.key()->waitForFinished(); }