[vlc-commits] qt: fix lock-order-inversion on open

Thomas Guillem git at videolan.org
Tue May 7 17:44:56 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue May  7 15:21:48 2019 +0200| [455ed9bcf807c76bdaef6c2cba593850cb03ef03] | committer: Thomas Guillem

qt: fix lock-order-inversion on open

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

 modules/gui/qt/qt.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/qt.cpp b/modules/gui/qt/qt.cpp
index 20fa3e5cf8..fd9c8ee77c 100644
--- a/modules/gui/qt/qt.cpp
+++ b/modules/gui/qt/qt.cpp
@@ -435,6 +435,9 @@ static int Open( vlc_object_t *p_this, bool isDialogProvider )
     }
 #endif
 
+    /* Get the playlist before the lock to avoid a lock-order-inversion */
+    vlc_playlist_t *playlist = vlc_intf_GetMainPlaylist(p_intf);
+
     vlc_mutex_locker locker (&lock);
     if (busy || open_state == OPEN_STATE_ERROR)
     {
@@ -449,7 +452,7 @@ static int Open( vlc_object_t *p_this, bool isDialogProvider )
     p_sys->p_mi = NULL;
 
     /* set up the playlist to work on */
-    p_sys->p_playlist = vlc_intf_GetMainPlaylist(p_intf);
+    p_sys->p_playlist = playlist;
     p_sys->p_player = vlc_playlist_GetPlayer( p_sys->p_playlist );
 
     /* */



More information about the vlc-commits mailing list