Commit c2447f7d authored by Rémi Denis-Courmont's avatar 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
parent 269b9f1b
...@@ -359,13 +359,10 @@ static void Close( vlc_object_t *p_this ) ...@@ -359,13 +359,10 @@ static void Close( vlc_object_t *p_this )
var_Destroy (pl_Get(p_this), "qt4-iface"); var_Destroy (pl_Get(p_this), "qt4-iface");
/* And quit */ /* And quit */
msg_Dbg( p_intf, "Please die, die, die..." ); msg_Dbg( p_this, "requesting exit..." );
QApplication::closeAllWindows();
// QApplication::quit();
QVLCApp::triggerQuit(); 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); vlc_join (p_sys->thread, NULL);
#ifdef Q_WS_X11 #ifdef Q_WS_X11
free (x11_display); free (x11_display);
......
...@@ -40,10 +40,17 @@ class QVLCApp : public QApplication ...@@ -40,10 +40,17 @@ class QVLCApp : public QApplication
{ {
Q_OBJECT Q_OBJECT
private slots:
void doQuit()
{
closeAllWindows();
quit();
}
public: public:
QVLCApp( int & argc, char ** argv ) : QApplication( argc, argv, true ) 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() static void triggerQuit()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment