Commit 721758e7 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Better solution to fix some skins2 crash on exit.

parent a1d12e8c
...@@ -104,6 +104,10 @@ public: ...@@ -104,6 +104,10 @@ public:
if( instance ) delete instance; if( instance ) delete instance;
instance = NULL; instance = NULL;
} }
static bool isAlive()
{
return ( instance != NULL );
}
virtual ~DialogsProvider(); virtual ~DialogsProvider();
QTimer *fixed_timer; QTimer *fixed_timer;
......
...@@ -272,8 +272,9 @@ static void Close( vlc_object_t *p_this ) ...@@ -272,8 +272,9 @@ static void Close( vlc_object_t *p_this )
if( p_intf->p_sys->b_isDialogProvider ) if( p_intf->p_sys->b_isDialogProvider )
{ {
if( p_intf->p_sys->p_dp ) if( DialogsProvider::isAlive() )
{ {
msg_Dbg( p_intf, "Asking the DP to quit nicely" );
DialogEvent *event = new DialogEvent( INTF_DIALOG_EXIT, 0, NULL ); DialogEvent *event = new DialogEvent( INTF_DIALOG_EXIT, 0, NULL );
QApplication::postEvent( THEDP, static_cast<QEvent*>(event) ); QApplication::postEvent( THEDP, static_cast<QEvent*>(event) );
} }
...@@ -344,7 +345,7 @@ static void *Init( vlc_object_t *obj ) ...@@ -344,7 +345,7 @@ static void *Init( vlc_object_t *obj )
app->setWindowIcon( QIcon( QPixmap(vlc_xpm) ) ); app->setWindowIcon( QIcon( QPixmap(vlc_xpm) ) );
/* Initialize timers and the Dialog Provider */ /* Initialize timers and the Dialog Provider */
p_intf->p_sys->p_dp = DialogsProvider::getInstance( p_intf ); DialogsProvider::getInstance( p_intf );
QPointer<MainInterface> *miP = NULL; QPointer<MainInterface> *miP = NULL;
...@@ -451,7 +452,6 @@ static void *Init( vlc_object_t *obj ) ...@@ -451,7 +452,6 @@ static void *Init( vlc_object_t *obj )
Settings must be destroyed after that. Settings must be destroyed after that.
*/ */
DialogsProvider::killInstance(); DialogsProvider::killInstance();
p_intf->p_sys->p_dp = NULL;
/* Delete the configuration. Application has to be deleted after that. */ /* Delete the configuration. Application has to be deleted after that. */
delete p_intf->p_sys->mainSettings; delete p_intf->p_sys->mainSettings;
......
...@@ -52,7 +52,6 @@ struct intf_sys_t ...@@ -52,7 +52,6 @@ struct intf_sys_t
{ {
QApplication *p_app; QApplication *p_app;
MainInterface *p_mi; MainInterface *p_mi;
DialogsProvider *p_dp;
QSettings *mainSettings; QSettings *mainSettings;
......
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