Commit e12ddbf2 authored by Clément Stenac's avatar Clément Stenac

Fix Qt crash on exit

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