mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 09:05:57 -05:00
Remove workaround to avoid race conditions
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user