Browse Source

libobs: Fix obs_view_remove only resetting the first matching mix

derrod 1 year ago
parent
commit
7c36257cc0
1 changed files with 4 additions and 3 deletions
  1. 4 3
      libobs/obs-view.c

+ 4 - 3
libobs/obs-view.c

@@ -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);
 }