changeset 4092:a3fc19130dce

add workaround to deadlock which occurs when "create a new playlist with matching entries" is checked in search and select dialog.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Wed, 19 Dec 2007 04:50:20 +0900
parents b03055a1437a
children cc8e81a84fa6
files src/audacious/ui_playlist_manager.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/ui_playlist_manager.c	Wed Dec 19 01:44:09 2007 +0900
+++ b/src/audacious/ui_playlist_manager.c	Wed Dec 19 04:50:20 2007 +0900
@@ -66,12 +66,16 @@
         gchar *pl_name = NULL;
         Playlist *playlist = (Playlist*)playlists->data;
 
-        PLAYLIST_LOCK(playlist);
+        if(playlist != active) //XXX the active playlist has been locked in playlist_new_from_selected()
+            PLAYLIST_LOCK(playlist);
+
         /* for each playlist, pick name and number of entries */
         pl_name = (gchar*)playlist_get_current_name( playlist );
         for (entries = playlist->entries; entries; entries = g_list_next(entries))
             entriesnum++;
-        PLAYLIST_UNLOCK(playlist);
+
+        if(playlist != active)
+            PLAYLIST_UNLOCK(playlist);
 
         /* update the tree model conservatively */