Browse Source

libobs: Do not signal reorder while scene mutex locked

Prevents a potential race condition with the scene mutex.
jp9000 7 years ago
parent
commit
f0164f9d28
1 changed files with 6 additions and 6 deletions
  1. 6 6
      libobs/obs-scene.c

+ 6 - 6
libobs/obs-scene.c

@@ -1645,9 +1645,9 @@ void obs_sceneitem_set_order(obs_sceneitem_t *item,
 		attach_sceneitem(scene, item, NULL);
 	}
 
-	signal_reorder(item);
-
 	full_unlock(scene);
+
+	signal_reorder(item);
 	obs_scene_release(scene);
 }
 
@@ -1677,9 +1677,9 @@ void obs_sceneitem_set_order_position(obs_sceneitem_t *item,
 		attach_sceneitem(scene, item, next);
 	}
 
-	signal_reorder(item);
-
 	full_unlock(scene);
+
+	signal_reorder(item);
 	obs_scene_release(scene);
 }
 
@@ -1921,9 +1921,9 @@ bool obs_scene_reorder_items(obs_scene_t *scene,
 		prev = item_order[i];
 	}
 
-	signal_reorder(scene->first_item);
-
 	full_unlock(scene);
+
+	signal_reorder(scene->first_item);
 	obs_scene_release(scene);
 	return true;
 }