1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-29 22:20:33 +00:00

Merge branch 'lua_worker_join' into 'master'

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

See merge request OpenMW/openmw!2044
This commit is contained in:
psi29a 2022-06-22 12:35:21 +00:00
commit e2ae381a6c

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)