Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WTrackMenu: Add warnings about limitations of lazy iteration #3233

Merged
merged 1 commit into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/widget/wtrackmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,8 @@ std::unique_ptr<mixxx::TrackPointerIterator> WTrackMenu::newTrackPointerIterator
if (m_trackIndexList.isEmpty()) {
return nullptr;
}
// m_pTrackModel must not be modified during the iteration,
// neither directly nor indirectly through signals!!!
return std::make_unique<mixxx::TrackPointerModelIterator>(
m_pTrackModel,
m_trackIndexList);
Expand Down
4 changes: 4 additions & 0 deletions src/widget/wtrackmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ class WTrackMenu : public QMenu {

std::unique_ptr<mixxx::TrackPointerIterator> newTrackPointerIterator() const;

/// WARNING: The provided pTrackPointerOperation must ensure NOT
/// TO MODIFY the underlying m_pTrackModel during the iteration!!!
/// This might happen not only directly but also indirectly by
/// handling signals, e.g. TrackDAO::enforceModelUpdate().
int applyTrackPointerOperation(
const QString& progressLabelText,
const mixxx::TrackPointerOperation* pTrackPointerOperation,
Expand Down