[vlc-devel] [PATCH 4/6] qt4: Move Qt4 interface cleanup to aboutToQuit() signal
Rémi Denis-Courmont
remi at remlab.net
Sat Jul 24 22:57:37 CEST 2010
Le samedi 24 juillet 2010 23:31:12 Juho Vähä-Herttua, vous avez écrit :
> ---
> modules/gui/qt4/qt4.cpp | 16 +++++++++++++---
> modules/gui/qt4/util/qvlcapp.hpp | 19 +++++++++++++++++++
> 2 files changed, 32 insertions(+), 3 deletions(-)
>
> diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
> index 676a82b..05ef8b8 100644
> --- a/modules/gui/qt4/qt4.cpp
> +++ b/modules/gui/qt4/qt4.cpp
> @@ -62,6 +62,7 @@ static void Close ( vlc_object_t * );
> static int WindowOpen ( vlc_object_t * );
> static void WindowClose ( vlc_object_t * );
> static void *Thread ( void * );
> +static void Cleanup ( void * );
> static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t *
> );
>
> /*************************************************************************
> **** @@ -406,6 +407,7 @@ static void *Thread( void *obj )
> #endif
>
> QVLCApp app( argc, argv );
> + app.registerCleanup( Cleanup, p_intf );
>
> p_intf->p_sys->p_app = &app;
>
> @@ -476,6 +478,17 @@ static void *Thread( void *obj )
> /* Launch */
> app.exec();
>
> + /* Delete the application automatically */
> + return NULL;
> +}
> +
> +static void Cleanup( void *obj )
> +{
> + intf_thread_t *p_intf = (intf_thread_t *)obj;
> + MainInterface *p_mi = p_intf->p_sys->p_mi;
> +
> + msg_Dbg( p_intf, "Cleaning up the interface" );
> +
> /* And quit */
> QApplication::closeAllWindows();
>
Currently, there does seem to be a race at exit between the interface thread
and the vout provider cleaning up. I am afraid this will makes our like even
more miserable when trying to fix it.
--
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis
More information about the vlc-devel
mailing list