Lua: Fix threading related crash

This commit is contained in:
Lion Kortlepel
2021-09-16 10:07:04 +02:00
parent 2cf368c2b0
commit 5978665ad6
4 changed files with 28 additions and 13 deletions

View File

@@ -8,6 +8,11 @@ public:
IThreaded()
// invokes operator() on this object
: mThread() { }
~IThreaded() noexcept {
if (mThread.joinable()) {
mThread.join();
}
}
virtual void Start() final {
mThread = std::thread([this] { (*this)(); });