diff --git a/libobs/obs-source.c b/libobs/obs-source.c index 98c03bde67040b..2a6a1d2dd1ca23 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -619,7 +619,13 @@ void obs_source_destroy(struct obs_source *source) if (!obs_source_valid(source, "obs_source_destroy")) return; - os_atomic_set_long(&source->destroying, true); + if (os_atomic_set_long(&source->destroying, true) == true) { + blog(LOG_ERROR, "Double destroy just occurred. " + "Something called addref on a source " + "after it was already fully released, " + "I guess."); + return; + } if (is_audio_source(source)) { pthread_mutex_lock(&source->audio_cb_mutex);