From 93bf866125cebeaf7b1ef7fc0b1afaf837c47568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 7 Apr 2018 17:46:17 +0200 Subject: [PATCH] UWP: Fix (or patch up...) a race condition in StorageFileLoader. Might help #10882, fixes some other freezes. Not convinced it's 100% correct but it appears to work, heh. Can't be bothered to investigate too deeply. --- UWP/StorageFileLoader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UWP/StorageFileLoader.cpp b/UWP/StorageFileLoader.cpp index f758912460..7253288fd4 100644 --- a/UWP/StorageFileLoader.cpp +++ b/UWP/StorageFileLoader.cpp @@ -19,10 +19,12 @@ StorageFileLoader::StorageFileLoader(Windows::Storage::StorageFile ^file) { } StorageFileLoader::~StorageFileLoader() { + initMutex.lock(); active_ = false; operationRequested_ = false; cond_.notify_all(); thread_->join(); + initMutex.unlock(); } void StorageFileLoader::threadfunc() {