fix holding lock during sleep

oops
This commit is contained in:
Lion Kortlepel committed 2026-04-19 18:17:54 +00:00
1 parent 3e12e487ab
commit 98fb12bbcc
1 file changed
+7 -2
+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 {