mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-16 19:31:02 +01:00
Clean GS pending requests when removing items, and don't try to modify non-existing items when receiving obsolete replies. Fix a crash when user tries to refresh GS items before every reply has been received
This commit is contained in:
parent
e545b6d71b
commit
1cb0869970
@ -451,6 +451,7 @@ void GroovesharkService::RemoveItems() {
|
||||
playlists_.clear();
|
||||
subscribed_playlists_parent_ = NULL;
|
||||
subscribed_playlists_.clear();
|
||||
pending_retrieve_playlists_.clear();
|
||||
}
|
||||
|
||||
void GroovesharkService::ResetSessionId() {
|
||||
@ -712,6 +713,9 @@ void GroovesharkService::PlaylistSongsRetrieved() {
|
||||
reply->deleteLater();
|
||||
|
||||
// Find corresponding playlist info
|
||||
if (!pending_retrieve_playlists_.contains(reply)) {
|
||||
return;
|
||||
};
|
||||
int playlist_id = pending_retrieve_playlists_.take(reply);
|
||||
PlaylistInfo& playlist_info = subscribed_playlists_.contains(playlist_id) ?
|
||||
subscribed_playlists_[playlist_id] : playlists_[playlist_id];
|
||||
|
Loading…
Reference in New Issue
Block a user