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

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


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue May  7 16:50:43 2019 +0200| [6ae141e21ab9d4e30191e13923c545d3f377303f] | committer: Thomas Guillem

qt: fix lock-order-inversion on close

p_sys->p_mi doesn't need to be protected here since only this thread can write
on it.

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

 modules/gui/qt/qt.cpp | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/modules/gui/qt/qt.cpp b/modules/gui/qt/qt.cpp
index fd9c8ee77c..9546a2e275 100644
--- a/modules/gui/qt/qt.cpp
+++ b/modules/gui/qt/qt.cpp
@@ -750,15 +750,15 @@ static void *ThreadCleanup( intf_thread_t *p_intf, bool error )
         }
         else
             open_state = OPEN_STATE_INIT;
+    }
 
-        if( p_sys->p_mi != NULL)
-        {
-            MainInterface *p_mi = p_sys->p_mi;
-            p_sys->p_mi = NULL;
-            /* Destroy first the main interface because it is connected to some
-               slots in the MainInputManager */
-            delete p_mi;
-        }
+    if( p_sys->p_mi != NULL)
+    {
+        MainInterface *p_mi = p_sys->p_mi;
+        p_sys->p_mi = NULL;
+        /* Destroy first the main interface because it is connected to some
+           slots in the MainInputManager */
+        delete p_mi;
     }
 
     /* */



More information about the vlc-commits mailing list