1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-04-02 01:06:40 +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)