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:
jp9000
2014-01-29 18:27:42 -07:00
parent 31ceec04ce
commit 3243a9f8c5
3 changed files with 12 additions and 24 deletions
+1 -1
View File
@@ -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();