[vlc-devel] commit: Better solution to fix some skins2 crash on exit. ( Jean-Baptiste Kempf )
git version control
git at videolan.org
Wed Aug 13 00:36:16 CEST 2008
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Aug 12 12:33:27 2008 -0700| [721758e782302fab1d6c6bc184fd4e7897fe9aca] | committer: Jean-Baptiste Kempf
Better solution to fix some skins2 crash on exit.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=721758e782302fab1d6c6bc184fd4e7897fe9aca
---
modules/gui/qt4/dialogs_provider.hpp | 4 ++++
modules/gui/qt4/qt4.cpp | 6 +++---
modules/gui/qt4/qt4.hpp | 1 -
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/modules/gui/qt4/dialogs_provider.hpp b/modules/gui/qt4/dialogs_provider.hpp
index 314e3ac..d1547b2 100644
--- a/modules/gui/qt4/dialogs_provider.hpp
+++ b/modules/gui/qt4/dialogs_provider.hpp
@@ -104,6 +104,10 @@ public:
if( instance ) delete instance;
instance = NULL;
}
+ static bool isAlive()
+ {
+ return ( instance != NULL );
+ }
virtual ~DialogsProvider();
QTimer *fixed_timer;
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index e92adc8..59ea681 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -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;
diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp
index f5951d4..0d16bc3 100644
--- a/modules/gui/qt4/qt4.hpp
+++ b/modules/gui/qt4/qt4.hpp
@@ -52,7 +52,6 @@ struct intf_sys_t
{
QApplication *p_app;
MainInterface *p_mi;
- DialogsProvider *p_dp;
QSettings *mainSettings;
More information about the vlc-devel
mailing list