From 1e0e3470cb2801b158c2b826061b9a1a42443912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Tue, 7 Sep 2021 10:41:41 +0200 Subject: [PATCH] Use queued connections for automatically loading new tracks from AutoDJPorcessor This ensures that the stack of slots connected to the original signal is fully processed. Fixes https://bugs.launchpad.net/mixxx/+bug/1941743 --- src/library/autodj/autodjfeature.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/library/autodj/autodjfeature.cpp b/src/library/autodj/autodjfeature.cpp index 805a9bb4211..be253659871 100644 --- a/src/library/autodj/autodjfeature.cpp +++ b/src/library/autodj/autodjfeature.cpp @@ -60,10 +60,15 @@ AutoDJFeature::AutoDJFeature(Library* pLibrary, qRegisterMetaType("AutoDJState"); m_pAutoDJProcessor = new AutoDJProcessor( this, m_pConfig, pPlayerManager, pLibrary->trackCollections(), m_iAutoDJPlaylistId); + + // Connect loadTrackToPlayer signal as a queued connection to make sure all callbacks of a + // previous load attempt have been called (lp1941743) connect(m_pAutoDJProcessor, &AutoDJProcessor::loadTrackToPlayer, this, - &LibraryFeature::loadTrackToPlayer); + &LibraryFeature::loadTrackToPlayer, + Qt::QueuedConnection); + m_playlistDao.setAutoDJProcessor(m_pAutoDJProcessor); // Create the "Crates" tree-item under the root item.