Fix crash when deleting macro with wait action

Note that this might still not be completely race free but should
improve the situation a lot.
This commit is contained in:
WarmUpTill
2021-08-07 09:55:56 +02:00
committed by WarmUpTill
parent 1474509cb9
commit 06ea7bf1d9
6 changed files with 14 additions and 6 deletions

View File

@@ -80,6 +80,8 @@ void AdvSceneSwitcher::on_macroRemove_clicked()
QString name;
{
std::lock_guard<std::mutex> lock(switcher->m);
switcher->abortMacroWait = true;
switcher->macroWaitCv.notify_one();
int idx = ui->macros->currentRow();
QString::fromStdString(switcher->macros[idx].Name());
switcher->macros.erase(switcher->macros.begin() + idx);