From 0bd054fd9fa156cc53194db50017bd98a1d6485f Mon Sep 17 00:00:00 2001 From: "v.audacity" Date: Sun, 17 Jun 2012 00:28:03 +0000 Subject: [PATCH] Fix http://bugzilla.audacityteam.org/show_bug.cgi?id=514 (P1). --- src/MixerBoard.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/MixerBoard.cpp b/src/MixerBoard.cpp index 80aa767b4..c72760a21 100644 --- a/src/MixerBoard.cpp +++ b/src/MixerBoard.cpp @@ -1038,7 +1038,7 @@ MixerBoard::~MixerBoard() // void MixerBoard::UpdateTrackClusters() { - if (mImageMuteUp == NULL) + if (!mImageMuteUp) this->CreateMuteSoloImages(); const int nClusterHeight = mScrolledWindow->GetClientSize().GetHeight() - kDoubleInset; @@ -1110,10 +1110,11 @@ void MixerBoard::UpdateTrackClusters() else if (nClusterIndex < nClusterCount) { // We've got too many clusters. - // This can only on things like Undo New Audio Track or Undo Import + // This can happen only on things like Undo New Audio Track or Undo Import // that don't call RemoveTrackCluster explicitly. - // We've already updated the track pointers for the clusters to the left, so just remove these. - for (; nClusterIndex < nClusterCount; nClusterIndex++) + // We've already updated the track pointers for the clusters to the left, so just remove all the rest. + // Keep nClusterIndex constant and successively delete from left to right. + for (unsigned int nCounter = nClusterIndex; nCounter < nClusterCount; nCounter++) #ifdef EXPERIMENTAL_MIDI_OUT this->RemoveTrackCluster(mMixerTrackClusters[nClusterIndex]->mTrack); #else