summaryrefslogtreecommitdiff
path: root/plugins/gtkui/fileman.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-04-25 21:49:34 +0200
committerGravatar waker <wakeroid@gmail.com>2011-04-25 21:49:34 +0200
commit43a277e9d2dfaa2055184617495e1d3a48b8d9cc (patch)
tree6e98e5d4df0299825c6ec21ca51c37ca23ccf9d2 /plugins/gtkui/fileman.c
parent3d8f7348c65f7b071ad488c6d09ecfa6e3baaee6 (diff)
new future-proof playlist API, potentially reducing locking, and allowing more flexibility
Diffstat (limited to 'plugins/gtkui/fileman.c')
-rw-r--r--plugins/gtkui/fileman.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/gtkui/fileman.c b/plugins/gtkui/fileman.c
index 6ff981b4..a832df09 100644
--- a/plugins/gtkui/fileman.c
+++ b/plugins/gtkui/fileman.c
@@ -26,9 +26,8 @@ gtkpl_add_dirs (GSList *lst) {
deadbeef->pl_add_files_begin (deadbeef->plt_get_curr ());
if (g_slist_length (lst) == 1
&& deadbeef->conf_get_int ("gtkui.name_playlist_from_folder", 0)) {
- int plt = deadbeef->plt_get_curr ();
- if (plt != -1) {
- void *p = deadbeef->plt_get_handle (plt);
+ ddb_playlist_t *p = deadbeef->plt_get_curr ();
+ if (p) {
char t[1000];
if (!deadbeef->plt_get_title (p, t, sizeof (t))) {
char *def = _("New Playlist");
@@ -40,6 +39,7 @@ gtkpl_add_dirs (GSList *lst) {
deadbeef->plt_set_title (p, folder+1);
}
}
+ deadbeef->plt_unref (p);
}
}
deadbeef->pl_unlock ();