Skip to content

Commit

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

Co-authored-by: Uwe Klotz <[email protected]>
  • Loading branch information
ronso0 and uklotzde committed Mar 28, 2024
1 parent e2d4199 commit 0fce87a
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 @@ -614,8 +614,13 @@ void DlgTrackInfo::saveTrack() {
static_cast<void>(updateKeyText()); // discard result

// 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));
//
// 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!
// Else triggering apply twice in quick succession might clear the metadata.
m_pLoadedTrack->replaceRecord(m_trackRecord, m_pBeatsClone);
}

void DlgTrackInfo::clear() {
Expand Down

0 comments on commit 0fce87a

Please sign in to comment.