fix holding lock during sleep

oops
This commit is contained in:
Lion Kortlepel
2026-04-18 18:46:02 +02:00
parent 3e12e487ab
commit 98fb12bbcc
+7 -2
View File
@@ -135,8 +135,13 @@ void TLuaEngine::operator()() {
}
}
}
std::unique_lock Lock(mLuaStatesMutex);
if (mLuaStates.empty()) {
bool StatesEmpty = false;
{
std::unique_lock Lock(mLuaStatesMutex);
StatesEmpty = mLuaStates.empty();
}
if (StatesEmpty) {
beammp_trace("No Lua states, event loop running extremely sparsely");
Application::SleepSafeSeconds(10);
} else {