Commit 1c9669ac 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.
parent 9a0e0822
...@@ -392,14 +392,10 @@ static void Close( vlc_object_t *p_this ) ...@@ -392,14 +392,10 @@ static void Close( vlc_object_t *p_this )
} }
/* 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..." );
#ifndef Q_WS_MAC #ifndef Q_WS_MAC
vlc_join (p_sys->thread, NULL); vlc_join (p_sys->thread, NULL);
#endif #endif
......
...@@ -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