diff --git a/src/widget/wtrackmenu.cpp b/src/widget/wtrackmenu.cpp index 11bc1c7488e..e1d8a268f1b 100644 --- a/src/widget/wtrackmenu.cpp +++ b/src/widget/wtrackmenu.cpp @@ -782,6 +782,8 @@ std::unique_ptr 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( m_pTrackModel, m_trackIndexList); diff --git a/src/widget/wtrackmenu.h b/src/widget/wtrackmenu.h index cd898fa5c16..ad569cf8a78 100644 --- a/src/widget/wtrackmenu.h +++ b/src/widget/wtrackmenu.h @@ -137,6 +137,10 @@ class WTrackMenu : public QMenu { std::unique_ptr 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,