]> git.sesse.net Git - vlc/commitdiff
Qt4: fix crash regression in 1.1.5 closeAllWindows() not thread-safe
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 21 Nov 2010 16:08:06 +0000 (18:08 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 21 Nov 2010 16:10:44 +0000 (18:10 +0200)
All UI related operations in Qt4 must be done on the UI thread, as
QtGui is not thread-safe internally.

modules/gui/qt4/qt4.cpp
modules/gui/qt4/util/qvlcapp.hpp

index 136995ced0e7d9cb70d3516904de1c8bc5e65c38..3f3beec1388a12d63143b613048c38d1c82dbe51 100644 (file)
@@ -392,14 +392,10 @@ static void Close( vlc_object_t *p_this )
     }
 
     /* And quit */
-    msg_Dbg( p_intf, "Please die, die, die..." );
-    QApplication::closeAllWindows();
-
-//    QApplication::quit();
-
+    msg_Dbg( p_this, "requesting exit..." );
     QVLCApp::triggerQuit();
 
-    msg_Dbg( p_intf, "Please die, die, die 2..." );
+    msg_Dbg( p_this, "waiting for UI thread..." );
 #ifndef Q_WS_MAC
     vlc_join (p_sys->thread, NULL);
 #endif
index c9de99a144617d5ee5e2db55e78891d44f4d0314..66fa024898d9eff6c0b53ab71fa86f539fbd301b 100644 (file)
@@ -40,10 +40,17 @@ class QVLCApp : public QApplication
 {
     Q_OBJECT
 
+private slots:
+    void doQuit()
+    {
+        closeAllWindows();
+        quit();
+    }
+
 public:
     QVLCApp( int & argc, char ** argv ) : QApplication( argc, argv, true )
     {
-        connect( this, SIGNAL(quitSignal()), this, SLOT(quit()) );
+        connect( this, SIGNAL(quitSignal()), this, SLOT(doQuit()) );
     }
 
     static void triggerQuit()