Browse Source

UI: Ignore scene source which has been removed

While getting source list, we should ignore scene source which has been
removed. If we don't ignore it, a deleted scene source will be added
later. Besides, signals of that scene have been sent before, such as
"remove" of scene. So we can't remove this scene source by "auto
removeItem" defined in SourceTreeItem::ReconnectSignals().

Fixes obsproject/obs-studio#2602
wangshaohui 4 năm trước cách đây
mục cha
commit
48b779c7b2
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      UI/source-tree.cpp

+ 5 - 0
UI/source-tree.cpp

@@ -608,6 +608,11 @@ static bool enumItem(obs_scene_t *, obs_sceneitem_t *item, void *ptr)
 	QVector<OBSSceneItem> &items =
 		*reinterpret_cast<QVector<OBSSceneItem> *>(ptr);
 
+	obs_source_t *src = obs_sceneitem_get_source(item);
+	if (obs_source_removed(src)) {
+		return true;
+	}
+
 	if (obs_sceneitem_is_group(item)) {
 		obs_data_t *data = obs_sceneitem_get_private_settings(item);