From 00e69c341e02494a5b6dd16f6588553189f9a0a0 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Mon, 4 Jun 2012 19:13:41 +0100 Subject: [PATCH] Fix a crash when switching between playlists while moodbars are loading --- src/moodbar/moodbaritemdelegate.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/moodbar/moodbaritemdelegate.cpp b/src/moodbar/moodbaritemdelegate.cpp index e1584518c..cb5826c42 100644 --- a/src/moodbar/moodbaritemdelegate.cpp +++ b/src/moodbar/moodbaritemdelegate.cpp @@ -259,8 +259,13 @@ void MoodbarItemDelegate::ImageLoaded(const QUrl& url, QFutureWatcher* w if (index.model() == filter) { source_index = filter->mapToSource(source_index); } - - Q_ASSERT(source_index.model() == playlist); + + if (source_index.model() != playlist) { + // The pixmap was for an index in a different playlist, maybe the user + // switched to a different one. + continue; + } + playlist->MoodbarUpdated(source_index); } }