libobs: Hide sources when an obs_view is destroyed

This fixes a bug where sources would not decrement their showing
references when an obs_view is destroyed.
master
jp9000 2015-03-02 00:32:06 -08:00
parent eed1a51d3a
commit ab520cab25
1 changed files with 7 additions and 2 deletions

View File

@ -48,8 +48,13 @@ void obs_view_free(struct obs_view *view)
{
if (!view) return;
for (size_t i = 0; i < MAX_CHANNELS; i++)
obs_source_release(view->channels[i]);
for (size_t i = 0; i < MAX_CHANNELS; i++) {
struct obs_source *source = view->channels[i];
if (source) {
obs_source_deactivate(source, AUX_VIEW);
obs_source_release(source);
}
}
memset(view->channels, 0, sizeof(view->channels));
pthread_mutex_destroy(&view->channels_mutex);