1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-04 21:40:03 +00:00

Correctly terminate LuaWorker if the game is being terminated due to an unhanded exception.

This commit is contained in:
Petr Mikheev 2022-06-21 20:56:19 +02:00
parent 1a478875f0
commit 241b414aa6

View File

@ -912,6 +912,15 @@ public:
mThread = std::thread([this]{ threadBody(); }); mThread = std::thread([this]{ threadBody(); });
}; };
~LuaWorker()
{
if (mThread && mThread->joinable())
{
Log(Debug::Error) << "Unexpected destruction of LuaWorker; likely there is an unhandled exception in the main thread.";
join();
}
}
void allowUpdate() void allowUpdate()
{ {
if (!mThread) if (!mThread)