mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-10 06:44:29 +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:
commit
e2ae381a6c
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user