Skip to content

Commit

Permalink
DlgTrackInfo: prevent wipe when quickly applying twice
Browse files Browse the repository at this point in the history
Fixes #12963

Co-authored-by: Uwe Klotz <uwe.klotz@gmail.com>
  • Loading branch information
ronso0 and uklotzde authored Mar 15, 2024
1 parent f74b726 commit d7de4c4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/library/dlgtrackinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,13 @@ void DlgTrackInfo::saveTrack() {
}

// Update the cached track
// The dialog is updated and repopulated by the Track::changed() signal.
m_pLoadedTrack->replaceRecord(std::move(m_trackRecord), std::move(m_pBeatsClone));
// Update the cached track
//
// If replaceRecord() returns true then both m_trackRecord and m_pBeatsClone
// will be updated by the subsequent Track::changed() signal to keep them
// synchronized with the track. Otherwise the track has not been modified and
// both members must remain valid. Do not use std::move() for passing arguments!
m_pLoadedTrack->replaceRecord(m_trackRecord, m_pBeatsClone);
}

void DlgTrackInfo::clear() {
Expand Down

0 comments on commit d7de4c4

Please sign in to comment.