From 6c251199f22853f3760f43408f59149712bcbd9c Mon Sep 17 00:00:00 2001
From: SeeLook <seelook@gmail.com>
Date: Sun, 7 Aug 2016 17:08:03 +0200
Subject: [PATCH] Invoke properly method finishCorrection() when only key
 signature was wrong and corrected. It fix  displaying 'what next tip' after

---
 src/score/tmainscore.cpp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/score/tmainscore.cpp b/src/score/tmainscore.cpp
index b793d19e0..b698c77a7 100644
--- a/src/score/tmainscore.cpp
+++ b/src/score/tmainscore.cpp
@@ -805,6 +805,7 @@ void TmainScore::strikeBlinkingFinished() {
 		m_strikeOut = 0;
 	}
   delete m_bliking;
+  m_bliking = 0;
 	if (m_correctNoteNr < 0) {
 		qDebug() << "TmainScore::strikeBlinkingFinished has wrong note number. Fix it!";
 		return;
@@ -833,14 +834,19 @@ void TmainScore::keyBlinkingFinished() {
 			m_keyBlinking->startBlinking(3); // and blink again
 	} else { // finished 2nd time
 			delete m_keyBlinking;
+      m_keyBlinking = 0;
+      if (!m_strikeOut && !m_bliking) // no other animations that will emit correctingFinished()
+        QTimer::singleShot(100, this, SLOT(finishCorrection())); // it might be invoked even immediately
 	}
 }
 
 
 void TmainScore::finishCorrection() {
-	noteFromId(m_correctNoteNr)->enableNoteAnim(false);
-	noteFromId(m_correctNoteNr)->markNote(QColor(Tcore::gl()->EanswerColor.lighter().name()));
-	m_correctNoteNr = -1;
+  if (m_correctNoteNr > -1) {
+    noteFromId(m_correctNoteNr)->enableNoteAnim(false);
+    noteFromId(m_correctNoteNr)->markNote(QColor(Tcore::gl()->EanswerColor.lighter().name()));
+    m_correctNoteNr = -1;
+  }
   emit correctingFinished();
 }
 
-- 
GitLab