mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
fix for crash on OBS close
This commit is contained in:
parent
9e4fc40c70
commit
23208fe8f7
|
|
@ -64,7 +64,6 @@ void Switcher::switcherThreadFunc() {
|
|||
else {
|
||||
//switch scene
|
||||
sceneName = sceneRoundTrip.at(roundTripPos + 1);
|
||||
obs_source_t * transitionUsed = obs_get_output_source(0);
|
||||
obs_source_t *source = obs_get_source_by_name(sceneName.c_str());
|
||||
if (source != NULL) {
|
||||
//create transition to new scene
|
||||
|
|
@ -372,8 +371,7 @@ string Switcher::GetActiveWindowTitle()
|
|||
//tell the thread to stop
|
||||
void Switcher::stop() {
|
||||
isRunning = false;
|
||||
switcherThread.join();
|
||||
return;
|
||||
if (switcherThread.joinable()) switcherThread.join();
|
||||
}
|
||||
|
||||
string Switcher::getSettingsFilePath()
|
||||
|
|
@ -386,6 +384,11 @@ void Switcher::setSettingsFilePath(string path)
|
|||
settings.setSettingsFilePath(path);
|
||||
}
|
||||
|
||||
Switcher::~Switcher()
|
||||
{
|
||||
stop();
|
||||
}
|
||||
|
||||
bool Switcher::getIsRunning()
|
||||
{
|
||||
return isRunning;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ public:
|
|||
string getSettingsFilePath();
|
||||
void setSettingsFilePath(string path);
|
||||
thread switcherThread;
|
||||
~Switcher();
|
||||
private:
|
||||
bool isRunning = true;
|
||||
Settings settings;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user