OSDN Git Service

Fix crash after removing target
authordt <qtc-committer@nokia.com>
Mon, 9 May 2011 12:16:19 +0000 (14:16 +0200)
committerdt <qtc-committer@nokia.com>
Mon, 9 May 2011 18:53:19 +0000 (20:53 +0200)
Reported on irc by ckamm

src/plugins/projectexplorer/targetselector.cpp

index bd41c22..dcb0618 100644 (file)
@@ -91,9 +91,7 @@ void TargetSelector::removeTarget(int index)
 
     m_targets.removeAt(index);
 
-    if (m_currentTargetIndex >= m_targets.count()) {
-        setCurrentIndex(-1);
-    } else if (m_currentTargetIndex >= index) {
+    if (m_currentTargetIndex > index) {
         --m_currentTargetIndex;
         // force a signal since the index has changed
         emit currentChanged(m_currentTargetIndex, m_targets.at(m_currentTargetIndex).currentSubIndex);