mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
Fix the design flaw with obs_sceneitem_destroy
The previous commit used the scene as a parameter to check to see if the scene item was still present within the scene before destroying, but this was actually unnecessary because the fault was because the destroy signal was being triggered *before* the scene's mutex locked, thus causing a race condition. I changed the code so that it signals after the lock instead of before, so the scene parameter should no longer be necessary.
This commit is contained in:
@@ -524,7 +524,7 @@ void OBSBasic::on_actionRemoveSource_triggered()
|
||||
|
||||
QVariant userData = sel->data(Qt::UserRole);
|
||||
obs_sceneitem_t item = VariantPtr<obs_sceneitem_t>(userData);
|
||||
obs_sceneitem_destroy(scene, item);
|
||||
obs_sceneitem_destroy(item);
|
||||
|
||||
obs_scene_release(scene);
|
||||
gs_leavecontext();
|
||||
|
||||
Reference in New Issue
Block a user