Commit e12ddbf2 authored by zorglub's avatar zorglub
Browse files

Fix Qt crash on exit

parent ace4087e
...@@ -39,6 +39,7 @@ public: ...@@ -39,6 +39,7 @@ public:
if( !instance) instance = new PlaylistDialog( p_intf ); if( !instance) instance = new PlaylistDialog( p_intf );
return instance; return instance;
} }
static void killInstance() { if( instance ) delete instance; }
virtual ~PlaylistDialog(); virtual ~PlaylistDialog();
private: private:
......
...@@ -52,6 +52,11 @@ DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) : ...@@ -52,6 +52,11 @@ DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) :
this, menuUpdateAction( QObject *) ); this, menuUpdateAction( QObject *) );
} }
DialogsProvider::~DialogsProvider()
{
PlaylistDialog::killInstance();
}
void DialogsProvider::customEvent( QEvent *event ) void DialogsProvider::customEvent( QEvent *event )
{ {
if( event->type() == DialogEvent_Type ) if( event->type() == DialogEvent_Type )
......
...@@ -52,7 +52,8 @@ public: ...@@ -52,7 +52,8 @@ public:
instance = new DialogsProvider( p_intf ); instance = new DialogsProvider( p_intf );
return instance; return instance;
} }
virtual ~DialogsProvider() {}; static void killInstance() { if( instance ) delete instance; }
virtual ~DialogsProvider();
QTimer *fixed_timer; QTimer *fixed_timer;
protected: protected:
friend class QVLCMenu; friend class QVLCMenu;
......
...@@ -276,6 +276,8 @@ void MainInterface::updateOnTimer() ...@@ -276,6 +276,8 @@ void MainInterface::updateOnTimer()
{ {
if( p_intf->b_die ) if( p_intf->b_die )
{ {
QApplication::closeAllWindows();
DialogsProvider::killInstance();
QApplication::quit(); QApplication::quit();
} }
audio_volume_t i_volume; audio_volume_t i_volume;
......
...@@ -145,7 +145,6 @@ static void Init( intf_thread_t *p_intf ) ...@@ -145,7 +145,6 @@ static void Init( intf_thread_t *p_intf )
app->setQuitOnLastWindowClosed( false ); app->setQuitOnLastWindowClosed( false );
app->exec(); app->exec();
// fprintf( stderr, "Qt execution terminated\n" );
MainInputManager::killInstance(); MainInputManager::killInstance();
delete p_intf->p_sys->p_mi; delete p_intf->p_sys->p_mi;
} }
......
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