Add option to prompt user for value to be assigned to variable

This commit is contained in:
WarmUpTill
2023-05-21 00:25:40 +02:00
committed by WarmUpTill
parent 258a5f6ab7
commit dea4ff47cd
5 changed files with 51 additions and 3 deletions

View File

@@ -439,6 +439,8 @@ void SwitcherData::Start()
}
}
bool CloseAllInputDialogs();
void SwitcherData::Stop()
{
if (th && th->isRunning()) {
@@ -447,10 +449,23 @@ void SwitcherData::Stop()
abortMacroWait = true;
macroWaitCv.notify_all();
macroTransitionCv.notify_all();
th->wait();
delete th;
th = nullptr;
// Not waiting if a dialog was closed is a workaround to avoid
// deadlocks when a variable input dialog is opened while Stop()
// is called.
//
// The QEventLoop handling the dialog would not exit until Stop()
// would return, which itself would wait for the switcher thread
// to complete, which itself is blocked by the variable input
// dialog.
//
// Must be reworked in the future, as this will not go well when
// OBS is shutting down and a dialog is still opened.
if (!CloseAllInputDialogs()) {
th->wait();
delete th;
th = nullptr;
}
writeToStatusFile("Advanced Scene Switcher stopped");
}