Remove workaround to avoid race conditions

This commit is contained in:
WarmUpTill
2023-01-25 20:06:35 +01:00
committed by WarmUpTill
parent 5366a4a6ed
commit 4a3d019f06
6 changed files with 72 additions and 48 deletions

View File

@@ -155,6 +155,7 @@ void SwitcherData::Thread()
while (true) {
std::unique_lock<std::mutex> lock(m);
mainLoopLock = &lock;
bool match = false;
OBSWeakSource scene;
@@ -230,19 +231,6 @@ void SwitcherData::Thread()
ClearWebsocketMessages();
// After this point we will call frontend functions like
// obs_frontend_set_current_scene() and
// obs_frontend_set_current_transition()
//
// During this time SaveSceneSwitcher() could be called
// leading to a deadlock with the frontend function being stuck
// in QMetaObject::invokeMethod() holding the mutex and
// OBS being stuck in SaveSceneSwitcher().
//
// So we have to unlock() risking race conditions as these are
// less frequent than the above described deadlock
lock.unlock();
if (match) {
if (macroMatch) {
runMacros();