]> git.sesse.net Git - vlc/commitdiff
Better solution to fix some skins2 crash on exit.
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 12 Aug 2008 19:33:27 +0000 (12:33 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 12 Aug 2008 22:39:02 +0000 (15:39 -0700)
modules/gui/qt4/dialogs_provider.hpp
modules/gui/qt4/qt4.cpp
modules/gui/qt4/qt4.hpp

index 314e3ac07d2d8d101c6f723b757cbfcf53363ed3..d1547b2048bbe659a6d7dce017d3ce663498faa2 100644 (file)
@@ -104,6 +104,10 @@ public:
         if( instance ) delete instance;
         instance = NULL;
     }
+    static bool isAlive()
+    {
+        return ( instance != NULL );
+    }
     virtual ~DialogsProvider();
     QTimer *fixed_timer;
 
index e92adc84d0d0302da414aab6de182949641bc000..59ea6810f6cf7db1547d4c45c784d6c5ec766441 100644 (file)
@@ -272,8 +272,9 @@ static void Close( vlc_object_t *p_this )
 
     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 );
             QApplication::postEvent( THEDP, static_cast<QEvent*>(event) );
         }
@@ -344,7 +345,7 @@ static void *Init( vlc_object_t *obj )
         app->setWindowIcon( QIcon( QPixmap(vlc_xpm) ) );
 
     /* Initialize timers and the Dialog Provider */
-    p_intf->p_sys->p_dp = DialogsProvider::getInstance( p_intf );
+    DialogsProvider::getInstance( p_intf );
 
     QPointer<MainInterface> *miP = NULL;
 
@@ -451,7 +452,6 @@ static void *Init( vlc_object_t *obj )
        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;
index f5951d42beb5420259b79370e3a4a38f8ff3afbe..0d16bc3d5634da5db01481af2fd1364e2c724e9b 100644 (file)
@@ -52,7 +52,6 @@ struct intf_sys_t
 {
     QApplication *p_app;
     MainInterface *p_mi;
-    DialogsProvider *p_dp;
 
     QSettings *mainSettings;