drag event in instrument list causes crash

• Feb 24, 2019 - 07:50
Reported version
3.0
Type
Graphical (UI)
Frequency
Many
Severity
S2 - Critical
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project

1) Open instruments for a score with more than one instrument.
2) Dont select any staff, or select any other staff
3) try to click and drag the mouse simuntaneously.
Easiest is to just click visible while moving mouse. That should crash immediately.

Crash output is a qassert:
instrwidget.cpp:unknown: ASSERT: "partiturList->currentItem() == item" in file MuseScore/mscore/instrwidget.cpp, line 509


Comments

Proposing fix:

diff --git a/mscore/instrwidget.cpp b/mscore/instrwidget.cpp
index 921a40d4d..d1a20bbd8 100644
--- a/mscore/instrwidget.cpp
+++ b/mscore/instrwidget.cpp
@@ -505,10 +505,12 @@ void InstrumentsWidget::on_partiturList_itemSelectionChanged()
         addStaffButton->setEnabled(false);
         return;
         }
+      // drag event causes this non-equality
+      if (partiturList->currentItem() != item)
+            return;
+
   QTreeWidgetItem* item = wi.front();
-      Q_ASSERT(partiturList->currentItem() == item);
   bool flag = item != nullptr;