libobs: Remove all callbacks on source destroy
Removes all callbacks in use on sources right when a source is about to be destroyed. Fixes a crash where callbacks would still be executed while in a destroyed state (particularly sidechain filters). Could also just mark the source as being in a destroyed state and not accept anymore obs_source_output_[audio/video] calls.
This commit is contained in:
parent
02409c46fa
commit
47d8f2e497
@ -614,6 +614,16 @@ void obs_source_destroy(struct obs_source *source)
|
||||
if (!obs_source_valid(source, "obs_source_destroy"))
|
||||
return;
|
||||
|
||||
if (is_audio_source(source)) {
|
||||
pthread_mutex_lock(&source->audio_cb_mutex);
|
||||
da_free(source->audio_cb_list);
|
||||
pthread_mutex_unlock(&source->audio_cb_mutex);
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&source->caption_cb_mutex);
|
||||
da_free(source->caption_cb_list);
|
||||
pthread_mutex_unlock(&source->caption_cb_mutex);
|
||||
|
||||
if (source->info.type == OBS_SOURCE_TYPE_TRANSITION)
|
||||
obs_transition_clear(source);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user