Commit a2731364 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Try to improve quitting of the application... Ref #1397

parent c47b2e44
...@@ -42,6 +42,11 @@ public: ...@@ -42,6 +42,11 @@ public:
static OpenDialog * getInstance( QWidget *parent, intf_thread_t *p_intf, static OpenDialog * getInstance( QWidget *parent, intf_thread_t *p_intf,
int _action_flag = 0, bool modal = false ); int _action_flag = 0, bool modal = false );
static void killInstance()
{
if( instance ) delete instance;
instance = NULL;
}
virtual ~OpenDialog(); virtual ~OpenDialog();
void showTab( int ); void showTab( int );
......
...@@ -112,7 +112,7 @@ public: ...@@ -112,7 +112,7 @@ public:
static void killInstance() static void killInstance()
{ {
if( instance ) delete instance; if( instance ) delete instance;
instance=NULL; instance = NULL;
} }
virtual ~DialogsProvider(); virtual ~DialogsProvider();
QTimer *fixed_timer; QTimer *fixed_timer;
......
...@@ -213,7 +213,6 @@ void InputManager::customEvent( QEvent *event ) ...@@ -213,7 +213,6 @@ void InputManager::customEvent( QEvent *event )
delInput(); delInput();
return; return;
} }
IMEvent *ime = static_cast<IMEvent *>(event); IMEvent *ime = static_cast<IMEvent *>(event);
...@@ -288,7 +287,7 @@ void InputManager::UpdateRate( void ) ...@@ -288,7 +287,7 @@ void InputManager::UpdateRate( void )
i_rate = i_new_rate; i_rate = i_new_rate;
/* Update rate */ /* Update rate */
emit rateChanged( i_rate ); emit rateChanged( i_rate );
} }
} }
void InputManager::UpdateMeta( void ) void InputManager::UpdateMeta( void )
...@@ -479,8 +478,8 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf ) : QObject(NULL), ...@@ -479,8 +478,8 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf ) : QObject(NULL),
MainInputManager::~MainInputManager() MainInputManager::~MainInputManager()
{ {
if( p_input ) if( p_input )
{ {
vlc_object_release( p_input ); vlc_object_release( p_input );
emit inputChanged( NULL ); emit inputChanged( NULL );
} }
...@@ -500,7 +499,7 @@ void MainInputManager::customEvent( QEvent *event ) ...@@ -500,7 +499,7 @@ void MainInputManager::customEvent( QEvent *event )
emit volumeChanged(); emit volumeChanged();
return; return;
} }
if( VLC_OBJECT_INTF == p_intf->i_object_type ) if( VLC_OBJECT_INTF == p_intf->i_object_type )
{ {
vlc_mutex_lock( &p_intf->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
......
...@@ -1132,9 +1132,7 @@ void MainInterface::wheelEvent( QWheelEvent *e ) ...@@ -1132,9 +1132,7 @@ void MainInterface::wheelEvent( QWheelEvent *e )
void MainInterface::closeEvent( QCloseEvent *e ) void MainInterface::closeEvent( QCloseEvent *e )
{ {
hide(); hide();
vlc_object_kill( p_intf ); THEDP->quit();
QApplication::closeAllWindows();
QApplication::quit();
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -289,7 +289,6 @@ static void Init( intf_thread_t *p_intf ) ...@@ -289,7 +289,6 @@ static void Init( intf_thread_t *p_intf )
p_mi->show(); p_mi->show();
} }
else else
/*if( p_intf->pf_show_dialog )*/
vlc_thread_ready( p_intf ); vlc_thread_ready( p_intf );
#ifdef ENABLE_NLS #ifdef ENABLE_NLS
...@@ -327,8 +326,18 @@ static void Init( intf_thread_t *p_intf ) ...@@ -327,8 +326,18 @@ static void Init( intf_thread_t *p_intf )
app->exec(); app->exec();
/* And quit */ /* And quit */
MainInputManager::killInstance();
/* Destroy first the main interface because it is connected to some slots
in the MainInputManager */
if( p_intf->p_sys->p_mi ) delete p_intf->p_sys->p_mi;
/* Destroy then other windows, because some are connected to some slots
in the MainInputManager */
DialogsProvider::killInstance(); DialogsProvider::killInstance();
/* Destroy the MainInputManager */
MainInputManager::killInstance();
delete app; delete app;
} }
......
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