Browse Source

Lock graphics before trying to remove a scene item

Prevents another deadlock if removing the scene item triggers source
cleanup of a source with graphics resources
Palana 11 years ago
parent
commit
31ceec04ce
1 changed files with 2 additions and 0 deletions
  1. 2 0
      obs/window-basic-main.cpp

+ 2 - 0
obs/window-basic-main.cpp

@@ -519,6 +519,7 @@ void OBSBasic::on_actionRemoveSource_triggered()
 	if (!scene)
 		return;
 
+	gs_entercontext(obs_graphics());
 	obs_scene_addref(scene);
 
 	QVariant userData = sel->data(Qt::UserRole);
@@ -526,6 +527,7 @@ void OBSBasic::on_actionRemoveSource_triggered()
 	obs_sceneitem_destroy(scene, item);
 
 	obs_scene_release(scene);
+	gs_leavecontext();
 }
 
 void OBSBasic::on_actionSourceProperties_triggered()