[vlc-devel] [PATCH 10/18] gui/qt: use vlc_playlist_locker in PLModel::filter

Filip Roséen filip at videolabs.io
Wed Jul 20 04:37:00 CEST 2016


---
 modules/gui/qt/components/playlist/playlist_model.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/components/playlist/playlist_model.cpp b/modules/gui/qt/components/playlist/playlist_model.cpp
index fdfec49..f81328f 100644
--- a/modules/gui/qt/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt/components/playlist/playlist_model.cpp
@@ -844,8 +844,9 @@ void PLModel::filter( const QString& search_text, const QModelIndex & idx, bool
     latestSearch = search_text;
 
     /** \todo Fire the search with a small delay ? */
-    PL_LOCK;
     {
+        vlc_playlist_locker pl_lock ( THEPL );
+
         playlist_item_t *p_root = playlist_ItemGetById( p_playlist,
                                             itemId( idx, PLAYLIST_ID ) );
         assert( p_root );
@@ -863,11 +864,10 @@ void PLModel::filter( const QString& search_text, const QModelIndex & idx, bool
             updateChildren( searchRoot ); // The PL_LOCK is needed here
             endInsertRows();
 
-            PL_UNLOCK;
             return;
         }
     }
-    PL_UNLOCK;
+
     rebuild();
 }
 
-- 
2.9.0



More information about the vlc-devel mailing list