[vlc-devel] commit: Fix some quitting issues from skins2 when Qt in theDP. ( Jean-Baptiste Kempf )

git version control git at videolan.org
Mon Aug 11 22:56:09 CEST 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Aug 11 13:58:20 2008 -0700| [56f13b36716751dfbdc0745198b9876a9dfffa12] | committer: Jean-Baptiste Kempf 

Fix some quitting issues from skins2 when Qt in theDP.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=56f13b36716751dfbdc0745198b9876a9dfffa12
---

 modules/gui/qt4/qt4.cpp |   25 ++++++++++++++++---------
 modules/gui/qt4/qt4.hpp |    1 +
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 89b2236..e92adc8 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -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;
 
diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp
index 0d16bc3..f5951d4 100644
--- a/modules/gui/qt4/qt4.hpp
+++ b/modules/gui/qt4/qt4.hpp
@@ -52,6 +52,7 @@ struct intf_sys_t
 {
     QApplication *p_app;
     MainInterface *p_mi;
+    DialogsProvider *p_dp;
 
     QSettings *mainSettings;
 




More information about the vlc-devel mailing list