Add option to stop plugin in case unclean shutdown is detected

This commit is contained in:
WarmUpTill
2025-12-28 21:32:01 +01:00
committed by WarmUpTill
parent 74a9681c8e
commit 628a4d896c
5 changed files with 155 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
#include "advanced-scene-switcher.hpp"
#include "backup.hpp"
#include "crash-handler.hpp"
#include "log-helper.hpp"
#include "macro-helpers.hpp"
#include "obs-module-helper.hpp"
@@ -207,9 +208,15 @@ static void SaveSceneSwitcher(obs_data_t *save_data, bool saving, void *)
switcher->LoadSettings(data);
switcher->m.unlock();
if (!switcher->stop) {
switcher->Start();
if (switcher->stop) {
return;
}
if (ShouldSkipPluginStartOnUncleanShutdown()) {
return;
}
switcher->Start();
}
}