diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-02-13 10:51:23 +0100 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-02-13 10:51:23 +0100 |
commit | 2ac056580814c151a58307a7b0c236f1912202c9 (patch) | |
tree | 61f9eab405d54ccb158488aedf1a9ef0161c8f98 /playlist.c | |
parent | eb09fe0fbb0a4ac90527e0234c9481033bd66abd (diff) |
fixed memleak in plt_free/plt_remove
Diffstat (limited to 'playlist.c')
-rw-r--r-- | playlist.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -234,9 +234,7 @@ plt_remove (int plt) { playlist->title = strdup ("Default"); PLT_UNLOCK; plt_gen_conf (); - if (!plt_loading) { - plug_trigger_event (DB_EV_PLAYLISTSWITCH, 0); - } + plug_trigger_event (DB_EV_PLAYLISTSWITCH, 0); return; } playlist_t *prev = NULL; @@ -256,6 +254,10 @@ plt_remove (int plt) { prev->next = p->next; } } + playlist_t *old = playlist; + playlist = p; + pl_clear (); + playlist = old; if (p == playlist) { playlist = prev ? prev : playlists_head; } @@ -347,6 +349,7 @@ plt_set_title (int plt, const char *title) { void plt_free (void) { + trace ("plt_free\n"); PLT_LOCK; plt_loading = 1; while (playlists_head) { |