mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 02:39:42 +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
1 changed files with 9 additions and 0 deletions
|
@ -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…
Reference in a new issue