core/playlists/library: Remove tracks from artist playlist when deleting

Otherwise we could leave artist playlists with invalid pointers.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2016-08-31 10:20:20 -04:00
parent 21718c4179
commit ae851ab4ea
2 changed files with 4 additions and 1 deletions

View File

@ -1,4 +1,5 @@
6.4.19:
- Remove deleted tracks from artist playlists
- File chooser selects user's music directory
- Remove deleted tracks from artist playlists

View File

@ -168,8 +168,10 @@ static bool pl_library_delete(const gchar *name)
if (!library)
return false;
queue_for_each(&playlist->pl_queue, &it)
queue_for_each(&playlist->pl_queue, &it) {
pl_system_delete_track(queue_iter_val(&it));
pl_artist_delete_track(queue_iter_val(&it));
}
__lib_pl_free(playlist);
track_remove_all(library);