Selaa lähdekoodia

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 vuotta sitten
vanhempi
sitoutus
361eebc6f3
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  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());
 }