mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-24 23:08:07 -05:00
Fix crash when switching scene collection during macro wait
Also update comment stating why the main mutex needs to be unlocked during the "action" phase of running macros
This commit is contained in:
parent
b786831f3b
commit
8ff50056f0
|
|
@ -232,12 +232,17 @@ void SwitcherData::Thread()
|
|||
}
|
||||
}
|
||||
|
||||
// After this point we will call frontend functions
|
||||
// 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, so we have to unlock()
|
||||
// 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) {
|
||||
|
|
|
|||
|
|
@ -492,7 +492,7 @@ bool SwitcherData::checkMacros()
|
|||
|
||||
bool SwitcherData::runMacros()
|
||||
{
|
||||
for (auto &m : macros) {
|
||||
for (auto m : macros) {
|
||||
if (m.Matched()) {
|
||||
vblog(LOG_INFO, "running macro: %s", m.Name().c_str());
|
||||
if (!m.PerformAction()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user