mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 21:40:03 +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(); });
|
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