summaryrefslogtreecommitdiffstats
path: root/src/library/library.cpp
diff options
context:
space:
mode:
authorUwe Klotz <uklotz@mixxx.org>2018-01-26 10:23:22 +0100
committerUwe Klotz <uklotz@mixxx.org>2018-01-26 10:23:22 +0100
commit75afcd7410e111a2010c59f23168b62476ff2f2d (patch)
tree9bb5f21fdcc67770cda634064528229633c18f18 /src/library/library.cpp
parente06d5314dde0bc8d878511e1b414b070c1f393db (diff)
Check main thread assumption in evictor callback implementation
Diffstat (limited to 'src/library/library.cpp')
-rw-r--r--src/library/library.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/library/library.cpp b/src/library/library.cpp
index 3e915c2421..9dd115c34e 100644
--- a/src/library/library.cpp
+++ b/src/library/library.cpp
@@ -423,5 +423,12 @@ void Library::slotSetTrackTableRowHeight(int rowHeight) {
}
void Library::afterEvictedTrackFromCache(GlobalTrackCacheLocker* pCacheLocker, Track* pTrack) {
+ // The evictor callback should always be called from the main
+ // thread, because the TrackDAO with the database connection
+ // is still bound to the main thread! We have to rethink this
+ // assertion after the multi-threaded database access layer is
+ // ready!
+ // TODO: Finish multi-threaded database access layer
+ DEBUG_ASSERT(QApplication::instance()->thread() == QThread::currentThread());
m_pTrackCollection->saveTrack(pCacheLocker, pTrack);
}