mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-12-29 11:01:23 +00:00
source-mirror: Additional protections against crashes on impossible behavior
This commit is contained in:
parent
ac06ff48bc
commit
844fcee0bd
1 changed files with 7 additions and 0 deletions
|
@ -626,6 +626,13 @@ void Source::Mirror::on_source_rename(obs::source* source, std::string new_name,
|
|||
|
||||
void Source::Mirror::on_source_destroy(obs::source* source)
|
||||
{
|
||||
// This is an odd case. If you hit this, be prepared for all kinds of broken things.
|
||||
this->m_source_target->clear();
|
||||
this->m_source_target.reset();
|
||||
this->m_audio_capture.reset();
|
||||
obs_sceneitem_remove(this->m_sceneitem);
|
||||
this->m_sceneitem = nullptr;
|
||||
|
||||
obs_data_t* ref = obs_source_get_settings(this->m_source);
|
||||
obs_data_set_string(ref, P_SOURCE, "");
|
||||
obs_source_update(this->m_source, ref);
|
||||
|
|
Loading…
Reference in a new issue