libobs: Fix obs_view_remove only resetting the first matching mix

This commit is contained in:
derrod
2023-12-02 18:03:11 -06:00
committed by Lain
parent f5fe9999b4
commit 7c36257cc0
+4 -3
View File
@@ -192,9 +192,10 @@ void obs_view_remove(obs_view_t *view)
return;
pthread_mutex_lock(&obs->video.mixes_mutex);
size_t idx = find_mix_for_view(view);
if (idx != DARRAY_INVALID)
obs->video.mixes.array[idx]->view = NULL;
for (size_t i = 0, num = obs->video.mixes.num; i < num; i++) {
if (obs->video.mixes.array[i]->view == view)
obs->video.mixes.array[i]->view = NULL;
}
set_main_mix();
pthread_mutex_unlock(&obs->video.mixes_mutex);
}