Skip to content

Commit

Permalink
Explain the race consition guraded by m_trackLoaded
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Mar 18, 2023
1 parent 5af6037 commit 43cde94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/widget/woverview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ void WOverview::slotLoadingTrack(TrackPointer pNewTrack, TrackPointer pOldTrack)
m_actualCompletion = 0;
m_waveformPeak = -1.0;
m_pixmapDone = false;
// Note: Here we already have the new track, but the engine and it's
// Control Objects may still have the old one until the slotTrackLoaded()
// signal has been received.
m_trackLoaded = false;
m_endOfTrack = false;

Expand Down
2 changes: 2 additions & 0 deletions src/widget/woverview.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ class WOverview : public WWidget, public TrackDropTarget {
if (m_trackLoaded) {
return m_trackSamplesControl->get();
} else {
// Ignore the value, because the engine can still have the old track
// during loading
return 0.0;
}
}
Expand Down

0 comments on commit 43cde94

Please sign in to comment.