diff --git a/CHANGELOG b/CHANGELOG index eb66527b..87069709 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ 6.4.19: +- Fix memory corruption when adding new library playlists - Use Enter key to accept new library paths - Remove deleted tracks from artist playlists - File chooser selects user's music directory diff --git a/core/playlists/library.c b/core/playlists/library.c index 0891b6e0..797ccca2 100644 --- a/core/playlists/library.c +++ b/core/playlists/library.c @@ -16,11 +16,11 @@ static bool __lib_pl_scan_dir(void *); static struct queue_ops *lib_ops = NULL; -static struct playlist *__lib_pl_alloc(const gchar *path) +static struct playlist *__lib_pl_alloc(struct library *library) { struct playlist *playlist = g_malloc(sizeof(struct playlist)); - playlist->pl_name = path; + playlist->pl_name = library->li_path; playlist->pl_type = PL_LIBRARY; playlist_generic_init(playlist, Q_REPEAT, lib_ops); @@ -153,7 +153,7 @@ static bool pl_library_new(const gchar *name) return false; library = library_find(name); - library->li_playlist = __lib_pl_alloc(name); + library->li_playlist = __lib_pl_alloc(library); __lib_pl_scan_dir_idle(library, name); return true; @@ -223,7 +223,7 @@ static bool __lib_pl_init(void *data) struct playlist *playlist; db_for_each(dbe, next, library_db_get()) { - playlist = __lib_pl_alloc(LIBRARY(dbe)->li_path); + playlist = __lib_pl_alloc(LIBRARY(dbe)); LIBRARY(dbe)->li_playlist = playlist; idle_schedule(IDLE_SYNC, __lib_pl_load, playlist);