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:
parent
1a478875f0
commit
241b414aa6
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user