Commit 5c1470d2 authored by Michael Pyne's avatar Michael Pyne

Fix crash in filtering playlist to playing album/artist.

This was caused by infinite recursion in trying to grab the list of
playlist items while trying to update the list of playlist items, which
could be most easily caused by clicking on the artist or album link in
the "now playing" bar while playing a song.

BUG:402355
FIXED-IN:18.12.3
parent f392c6dd
Pipeline #1041 passed with stage
in 15 minutes and 44 seconds
...@@ -779,7 +779,8 @@ void Playlist::removeFromDisk(const PlaylistItemList &items) ...@@ -779,7 +779,8 @@ void Playlist::removeFromDisk(const PlaylistItemList &items)
void Playlist::synchronizeItemsTo(const PlaylistItemList &itemList) void Playlist::synchronizeItemsTo(const PlaylistItemList &itemList)
{ {
const auto &existingItems = items(); // direct call to ::items to avoid infinite loop, bug 402355
const auto &existingItems = Playlist::items();
if(qAbs(itemList.count() - existingItems.count()) > if(qAbs(itemList.count() - existingItems.count()) >
qMax(itemList.count(), existingItems.count()) / 2) qMax(itemList.count(), existingItems.count()) / 2)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment