vlc | branch: master | Rémi Denis-Courmont <r...@remlab.net> | Sun Nov 21 
18:08:06 2010 +0200| [1c9669ac53e83beadcd112f909b239a9645b031c] | committer: 
Rémi Denis-Courmont 

Qt4: fix crash regression in 1.1.5 closeAllWindows() not thread-safe

All UI related operations in Qt4 must be done on the UI thread, as
QtGui is not thread-safe internally.

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

 modules/gui/qt4/qt4.cpp          |    8 ++------
 modules/gui/qt4/util/qvlcapp.hpp |    9 ++++++++-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 136995c..3f3beec 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -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
diff --git a/modules/gui/qt4/util/qvlcapp.hpp b/modules/gui/qt4/util/qvlcapp.hpp
index c9de99a..66fa024 100644
--- a/modules/gui/qt4/util/qvlcapp.hpp
+++ b/modules/gui/qt4/util/qvlcapp.hpp
@@ -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()

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to