Commit e8c2dbbf authored by Michael Pyne's avatar Michael Pyne
Browse files

Immediately update dynamic/search playlist items upon a change.

This is as opposed to recording the new list of PlaylistItems and then
effecting the change after draining the event loop (an attempt at
keeping GUI responsive if many updates are happening).

Otherwise it is possible to
- Generate a list of PlaylistItems to read from (when updating the
playlist) and push to end of event loop
- Delete some of those PlaylistItems due to already-queued events to
delete playlist items
- Finally try to use the list of PlaylistItems and run into a segfault
from trying to access a deleted PlaylistItem.

I think this should fix a crash when you delete multiple playlists.

parent ea1da148
......@@ -149,11 +149,9 @@ void DynamicPlaylist::updateItems()
for(PlaylistList::ConstIterator it = m_playlists.constBegin(); it != m_playlists.constEnd(); ++it)
siblings += (*it)->items();
PlaylistItemList newSiblings = siblings;
if(m_siblings != newSiblings) {
m_siblings = newSiblings;
QTimer::singleShot(0, this, SLOT(slotUpdateItems()));
if(m_siblings != siblings) {
m_siblings = siblings;
Supports Markdown
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