diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2021-03-18 23:32:57 +0100 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2021-03-18 23:35:06 +0100 |
commit | 57ebe8879f8797c1b28b98b38c316e99d1506676 (patch) | |
tree | 46247846841dab78780460ac7e8d1786f115e47a | |
parent | 27ab2d4546a1601f13e3ddd16b3c092b5b94663d (diff) |
Fix handling of dirty flag after updating beats
-rw-r--r-- | src/track/track.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/track/track.cpp b/src/track/track.cpp index 8e9ea393d6..59633fdbd9 100644 --- a/src/track/track.cpp +++ b/src/track/track.cpp @@ -999,19 +999,19 @@ bool Track::tryImportPendingBeatsMarkDirtyAndUnlock( return false; } - bool dirty = false; - + bool modified = false; + // Both functions must be invoked even if one of them + // returns false! if (importPendingBeatsWhileLocked()) { - dirty = true; + modified = true; } - if (compareAndSet(m_record.ptrBpmLocked(), lockBpmAfterSet)) { - dirty = true; + modified = true; } - - if (!dirty) { - // Already set, nothing todo - pLock->unlock(); + if (!modified) { + // Unmodified, nothing todo. Yet the internal dirty flag + // might have been set by a preceding operation! + markDirtyAndUnlock(pLock, false); return true; } |