Commit fce542a9 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/*: fixed clean-up of the dialogs provider on exit.
* modules/gui/skins/x11/*: proper initialization of a global var so we can start/exit the skins interface several times.
parent 50fd98c4
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* x11_run.cpp: * x11_run.cpp:
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: x11_run.cpp,v 1.23 2003/06/22 12:46:49 asmax Exp $ * $Id: x11_run.cpp,v 1.24 2003/07/25 22:50:12 gbazin Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -168,6 +168,7 @@ void OSRun( intf_thread_t *p_intf ) ...@@ -168,6 +168,7 @@ void OSRun( intf_thread_t *p_intf )
Display *display = ((OSTheme *)p_intf->p_sys->p_theme)->GetDisplay(); Display *display = ((OSTheme *)p_intf->p_sys->p_theme)->GetDisplay();
X11TimerManager::Initialize();
// Timer for SkinManage // Timer for SkinManage
X11Timer *refreshTimer = new X11Timer( p_intf, 100000, RefreshCallback, X11Timer *refreshTimer = new X11Timer( p_intf, 100000, RefreshCallback,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* x11_timer.cpp: helper class to implement timers * x11_timer.cpp: helper class to implement timers
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: x11_timer.cpp,v 1.4 2003/06/09 12:33:17 asmax Exp $ * $Id: x11_timer.cpp,v 1.5 2003/07/25 22:50:12 gbazin Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -75,7 +75,6 @@ bool X11Timer::Execute() ...@@ -75,7 +75,6 @@ bool X11Timer::Execute()
X11TimerManager *X11TimerManager::_instance = NULL; X11TimerManager *X11TimerManager::_instance = NULL;
X11TimerManager::X11TimerManager( intf_thread_t *p_intf ) X11TimerManager::X11TimerManager( intf_thread_t *p_intf )
{ {
_p_intf = p_intf; _p_intf = p_intf;
...@@ -97,6 +96,10 @@ X11TimerManager::~X11TimerManager() ...@@ -97,6 +96,10 @@ X11TimerManager::~X11TimerManager()
vlc_mutex_destroy( &_lock ); vlc_mutex_destroy( &_lock );
} }
void X11TimerManager::Initialize()
{
_instance = NULL;
}
// Return the instance of X11TimerManager (design pattern singleton) // Return the instance of X11TimerManager (design pattern singleton)
X11TimerManager *X11TimerManager::Instance( intf_thread_t *p_intf ) X11TimerManager *X11TimerManager::Instance( intf_thread_t *p_intf )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* x11_timer.h: helper class to implement timers * x11_timer.h: helper class to implement timers
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: x11_timer.h,v 1.5 2003/06/09 12:33:17 asmax Exp $ * $Id: x11_timer.h,v 1.6 2003/07/25 22:50:12 gbazin Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -79,6 +79,7 @@ class X11TimerManager ...@@ -79,6 +79,7 @@ class X11TimerManager
void WaitNextTimer(); void WaitNextTimer();
public: public:
static void Initialize();
static X11TimerManager *Instance( intf_thread_t *p_intf ); static X11TimerManager *Instance( intf_thread_t *p_intf );
void Destroy(); void Destroy();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dialogs.cpp : wxWindows plugin for vlc * dialogs.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: dialogs.cpp,v 1.5 2003/07/23 01:13:47 gbazin Exp $ * $Id: dialogs.cpp,v 1.6 2003/07/25 22:50:12 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -329,6 +329,5 @@ void DialogsProvider::OnPopupMenu( wxCommandEvent& event ) ...@@ -329,6 +329,5 @@ void DialogsProvider::OnPopupMenu( wxCommandEvent& event )
void DialogsProvider::OnExitThread( wxCommandEvent& WXUNUSED(event) ) void DialogsProvider::OnExitThread( wxCommandEvent& WXUNUSED(event) )
{ {
delete this;
wxTheApp->ExitMainLoop(); wxTheApp->ExitMainLoop();
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wxwindows.cpp : wxWindows plugin for vlc * wxwindows.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: wxwindows.cpp,v 1.26 2003/07/25 13:24:29 gbazin Exp $ * $Id: wxwindows.cpp,v 1.27 2003/07/25 22:50:12 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -162,8 +162,6 @@ static void Close( vlc_object_t *p_this ) ...@@ -162,8 +162,6 @@ static void Close( vlc_object_t *p_this )
vlc_object_release( p_intf->p_sys->p_input ); vlc_object_release( p_intf->p_sys->p_input );
} }
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
if( p_intf->pf_show_dialog ) if( p_intf->pf_show_dialog )
{ {
/* We must destroy the dialogs thread */ /* We must destroy the dialogs thread */
...@@ -172,6 +170,8 @@ static void Close( vlc_object_t *p_this ) ...@@ -172,6 +170,8 @@ static void Close( vlc_object_t *p_this )
vlc_thread_join( p_intf ); vlc_thread_join( p_intf );
} }
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
/* Destroy structure */ /* Destroy structure */
free( p_intf->p_sys ); free( p_intf->p_sys );
} }
...@@ -229,6 +229,12 @@ static void Init( intf_thread_t *p_intf ) ...@@ -229,6 +229,12 @@ static void Init( intf_thread_t *p_intf )
#else #else
wxEntry( i_args, p_args ); wxEntry( i_args, p_args );
#endif #endif
if( p_intf->pf_show_dialog )
{
/* We need to manually clean up the dialogs class */
if( p_intf->p_sys->p_wxwindow ) delete p_intf->p_sys->p_wxwindow;
}
} }
/* following functions are local */ /* following functions are local */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment