From 47867d427f46a8478aa0107738adab1bfbfc7c56 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Fri, 17 Apr 2020 10:23:10 -0400 Subject: fixed crash when switching to an instance with a lower refresh thread count fixed rare race condition when waking up handle closer threads --- src/envfs.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/envfs.h') diff --git a/src/envfs.h b/src/envfs.h index 8790b071..bbc27005 100644 --- a/src/envfs.h +++ b/src/envfs.h @@ -128,6 +128,15 @@ private: thread = std::thread([&]{ run(); }); } + ~ThreadInfo() + { + if (thread.joinable()) { + stop = true; + wakeup(); + thread.join(); + } + } + void wakeup() { { -- cgit v1.3.1