浏览代码

UI: Handle (de)select scene items queued

The (de)select signal can come from a obs_scene_enum_items
which locks the scene. The Qt::QueuedConnection makes sure
the (de)select is handled outside of that lock.
Fixes the deadlock from #3673
Exeldro 4 年之前
父节点
当前提交
d68484e7b7
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      UI/source-tree.cpp

+ 4 - 2
UI/source-tree.cpp

@@ -227,7 +227,8 @@ void SourceTreeItem::ReconnectSignals()
 			(obs_sceneitem_t *)calldata_ptr(cd, "item");
 
 		if (curItem == this_->sceneitem)
-			QMetaObject::invokeMethod(this_, "Select");
+			QMetaObject::invokeMethod(this_, "Select",
+						  Qt::QueuedConnection);
 	};
 
 	auto itemDeselect = [](void *data, calldata_t *cd) {
@@ -237,7 +238,8 @@ void SourceTreeItem::ReconnectSignals()
 			(obs_sceneitem_t *)calldata_ptr(cd, "item");
 
 		if (curItem == this_->sceneitem)
-			QMetaObject::invokeMethod(this_, "Deselect");
+			QMetaObject::invokeMethod(this_, "Deselect",
+						  Qt::QueuedConnection);
 	};
 
 	auto reorderGroup = [](void *data, calldata_t *) {