[vlc-commits] commit: Qt4: fix crash regression in 1.1.5 closeAllWindows() not thread-safe (=?UTF-8?Q?R=C3=A9mi=20Denis=2DCourmont=20?=)
git at videolan.org
git at videolan.org
Sun Nov 21 17:13:13 CET 2010
vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Nov 21 18:13:06 2010 +0200| [c2447f7d0721d91e16aac3fde829152f8ca35359] | 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.
(cherry picked from commit 1c9669ac53e83beadcd112f909b239a9645b031c)
Conflicts:
modules/gui/qt4/qt4.cpp
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=c2447f7d0721d91e16aac3fde829152f8ca35359
---
modules/gui/qt4/qt4.cpp | 7 ++-----
modules/gui/qt4/util/qvlcapp.hpp | 9 ++++++++-
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 98d8aa6..aa7a182 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -359,13 +359,10 @@ static void Close( vlc_object_t *p_this )
var_Destroy (pl_Get(p_this), "qt4-iface");
/* 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..." );
vlc_join (p_sys->thread, NULL);
#ifdef Q_WS_X11
free (x11_display);
diff --git a/modules/gui/qt4/util/qvlcapp.hpp b/modules/gui/qt4/util/qvlcapp.hpp
index bfd8a90..3e016f2 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()
More information about the vlc-commits
mailing list