[vlc-commits] gui/qt: use vlc_playlist_locker in PLModel::rebuild

Filip Roséen git at videolan.org
Wed Jul 20 16:15:55 CEST 2016


vlc | branch: master | Filip Roséen <filip at videolabs.io> | Wed Jul 20 04:36:58 2016 +0200| [592e11fc90ed4380e22f703e0d6c100a9ec103af] | committer: Jean-Baptiste Kempf

gui/qt: use vlc_playlist_locker in PLModel::rebuild

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=592e11fc90ed4380e22f703e0d6c100a9ec103af
---

 .../gui/qt/components/playlist/playlist_model.cpp  |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/modules/gui/qt/components/playlist/playlist_model.cpp b/modules/gui/qt/components/playlist/playlist_model.cpp
index a115e02..29f3f62 100644
--- a/modules/gui/qt/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt/components/playlist/playlist_model.cpp
@@ -642,17 +642,19 @@ void PLModel::rebuild( playlist_item_t *p_root )
 {
     beginResetModel();
 
-    PL_LOCK;
-    if( rootItem ) rootItem->clearChildren();
-    if( p_root ) // Can be NULL
     {
-        if ( rootItem ) delete rootItem;
-        rootItem = new PLItem( p_root );
+        vlc_playlist_locker pl_lock ( THEPL );
+
+        if( rootItem ) rootItem->clearChildren();
+        if( p_root ) // Can be NULL
+        {
+            if ( rootItem ) delete rootItem;
+            rootItem = new PLItem( p_root );
+        }
+        assert( rootItem );
+        /* Recreate from root */
+        updateChildren( rootItem );
     }
-    assert( rootItem );
-    /* Recreate from root */
-    updateChildren( rootItem );
-    PL_UNLOCK;
 
     /* And signal the view */
     endResetModel();



More information about the vlc-commits mailing list