1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +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(); });
};
~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()
{
if (!mThread)