diff --git a/libobs/obs-scene.c b/libobs/obs-scene.c index 29fc6b011..3925a9f71 100644 --- a/libobs/obs-scene.c +++ b/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); diff --git a/libobs/obs-scene.h b/libobs/obs-scene.h index 14baf4f69..3c9e9ffcc 100644 --- a/libobs/obs-scene.h +++ b/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; };