]> git.sesse.net Git - vlc/commitdiff
Fix some quitting issues from skins2 when Qt in theDP.
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 11 Aug 2008 20:58:20 +0000 (13:58 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 11 Aug 2008 20:58:59 +0000 (13:58 -0700)
modules/gui/qt4/qt4.cpp
modules/gui/qt4/qt4.hpp

index 89b223624a715f8e15877ee0c7b19ae79e170eaf..e92adc84d0d0302da414aab6de182949641bc000 100644 (file)
@@ -272,9 +272,11 @@ static void Close( vlc_object_t *p_this )
 
     if( p_intf->p_sys->b_isDialogProvider )
     {
-        DialogEvent *event = new DialogEvent( INTF_DIALOG_EXIT, 0, NULL );
-        QApplication::postEvent( THEDP, static_cast<QEvent*>(event) );
-
+        if( p_intf->p_sys->p_dp )
+        {
+            DialogEvent *event = new DialogEvent( INTF_DIALOG_EXIT, 0, NULL );
+            QApplication::postEvent( THEDP, static_cast<QEvent*>(event) );
+        }
         vlc_thread_join( p_intf );
     }
 
@@ -342,7 +344,7 @@ static void *Init( vlc_object_t *obj )
         app->setWindowIcon( QIcon( QPixmap(vlc_xpm) ) );
 
     /* Initialize timers and the Dialog Provider */
-    DialogsProvider::getInstance( p_intf );
+    p_intf->p_sys->p_dp = DialogsProvider::getInstance( p_intf );
 
     QPointer<MainInterface> *miP = NULL;
 
@@ -424,6 +426,7 @@ static void *Init( vlc_object_t *obj )
     app->exec();
 
     /* And quit */
+    msg_Dbg( p_intf, "Quitting the Qt4 Interface" );
 
     if (miP)
     {
@@ -442,16 +445,20 @@ static void *Init( vlc_object_t *obj )
        in the MainInputManager */
     delete p_intf->p_sys->p_mi;
 
-    /* Destroy then other windows, because some are connected to some slots
-       in the MainInputManager */
+    /* Destroy all remaining windows,
+       because some are connected to some slots
+       in the MainInputManager
+       Settings must be destroyed after that.
+     */
     DialogsProvider::killInstance();
+    p_intf->p_sys->p_dp = NULL;
+
+    /* Delete the configuration. Application has to be deleted after that. */
+    delete p_intf->p_sys->mainSettings;
 
     /* Destroy the MainInputManager */
     MainInputManager::killInstance();
 
-    /* Delete the configuration */
-    delete p_intf->p_sys->mainSettings;
-
     /* Delete the application */
     delete app;
 
index 0d16bc3d5634da5db01481af2fd1364e2c724e9b..f5951d42beb5420259b79370e3a4a38f8ff3afbe 100644 (file)
@@ -52,6 +52,7 @@ struct intf_sys_t
 {
     QApplication *p_app;
     MainInterface *p_mi;
+    DialogsProvider *p_dp;
 
     QSettings *mainSettings;