fix for crash on OBS close

This commit is contained in:
WarmUpTill 2016-08-17 16:59:20 +02:00 committed by GitHub
parent 9e4fc40c70
commit 23208fe8f7
2 changed files with 7 additions and 3 deletions

View File

@ -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;

View File

@ -17,6 +17,7 @@ public:
string getSettingsFilePath();
void setSettingsFilePath(string path);
thread switcherThread;
~Switcher();
private:
bool isRunning = true;
Settings settings;