Преглед на файлове

UI: Fix scene list crash

The original change in obsproject/obs-studio#7200 seems to have been
based upon the idea that if the "selected" parameter has no values, then
the "deselected" parameter must have values, which is clearly an unsafe
assumption to have make given that it causes an assert crash in Qt when
both parameters have 0 values contained within them.
jp9000 преди 3 години
родител
ревизия
361eebc6f3
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      UI/scene-tree.cpp

+ 1 - 1
UI/scene-tree.cpp

@@ -253,6 +253,6 @@ void SceneTree::rowsInserted(const QModelIndex &parent, int start, int end)
 void SceneTree::selectionChanged(const QItemSelection &selected,
 				 const QItemSelection &deselected)
 {
-	if (selected.count() == 0)
+	if (selected.count() == 0 && deselected.count() > 0)
 		setCurrentRow(deselected.indexes().front().row());
 }