Selaa lähdekoodia

forgot to lock the mutex when destroying a scene item

jp9000 11 vuotta sitten
vanhempi
sitoutus
1c91e0d0e0
2 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 3 0
      libobs/obs-scene.c
  2. 1 1
      libobs/obs-scene.h

+ 3 - 0
libobs/obs-scene.c

@@ -263,7 +263,10 @@ int obs_sceneitem_destroy(obs_sceneitem_t item)
 	int ref = 0;
 
 	if (item) {
+		pthread_mutex_lock(&item->parent->mutex);
 		detach_sceneitem(item);
+		pthread_mutex_unlock(&item->parent->mutex);
+
 		if (item->source)
 			ref = obs_source_release(item->source);
 		bfree(item);

+ 1 - 1
libobs/obs-scene.h

@@ -32,7 +32,7 @@ struct obs_scene_item {
 	struct vec2           scale;
 	float                 rot;
 
-	/* would do **prev_next, but not really great for resorting */
+	/* would do **prev_next, but not really great for reordering */
 	struct obs_scene_item *prev;
 	struct obs_scene_item *next;
 };