From 844fcee0bdd331f6a433c92786a09d0035939e08 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 8 Nov 2018 08:17:04 +0100 Subject: [PATCH] source-mirror: Additional protections against crashes on impossible behavior --- source/source-mirror.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/source-mirror.cpp b/source/source-mirror.cpp index 787d898..1f0af2b 100644 --- a/source/source-mirror.cpp +++ b/source/source-mirror.cpp @@ -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);