]> git.sesse.net Git - vlc/commitdiff
* modules/gui/wxwindows/*: fixed clean-up of the dialogs provider on exit.
authorGildas Bazin <gbazin@videolan.org>
Fri, 25 Jul 2003 22:50:12 +0000 (22:50 +0000)
committerGildas Bazin <gbazin@videolan.org>
Fri, 25 Jul 2003 22:50:12 +0000 (22:50 +0000)
* modules/gui/skins/x11/*: proper initialization of a global var so we can start/exit the skins interface several times.

modules/gui/skins/x11/x11_run.cpp
modules/gui/skins/x11/x11_timer.cpp
modules/gui/skins/x11/x11_timer.h
modules/gui/wxwindows/dialogs.cpp
modules/gui/wxwindows/wxwindows.cpp

index 10c4ae4cd1424721f9a46856c826433aef09b9db..13e7ae46de63b5b9e78c702b3869933d8aaa4a11 100644 (file)
@@ -2,7 +2,7 @@
  * x11_run.cpp:
  *****************************************************************************
  * 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>
  *
@@ -168,6 +168,7 @@ void OSRun( intf_thread_t *p_intf )
 
     Display *display = ((OSTheme *)p_intf->p_sys->p_theme)->GetDisplay();
 
+    X11TimerManager::Initialize();
 
     // Timer for SkinManage
     X11Timer *refreshTimer = new X11Timer( p_intf, 100000, RefreshCallback,
index 02a11622b9312c605d0540df94dbd73ba5ce5052..dbebc36b7bec4f7d12d002dcd16c37f7b41154b5 100644 (file)
@@ -2,7 +2,7 @@
  * x11_timer.cpp: helper class to implement timers
  *****************************************************************************
  * 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>
  *
@@ -75,7 +75,6 @@ bool X11Timer::Execute()
 
 X11TimerManager *X11TimerManager::_instance = NULL;
 
-
 X11TimerManager::X11TimerManager( intf_thread_t *p_intf )
 {
     _p_intf = p_intf;
@@ -97,6 +96,10 @@ X11TimerManager::~X11TimerManager()
     vlc_mutex_destroy( &_lock );
 }
 
+void X11TimerManager::Initialize()
+{
+    _instance = NULL;
+}
 
 // Return the instance of X11TimerManager (design pattern singleton)
 X11TimerManager *X11TimerManager::Instance( intf_thread_t *p_intf )
index ef1765c0731493de258f370d7605e94a066a9c58..4a7b9d9913465451268a4be58a9423f849bd44fd 100644 (file)
@@ -2,7 +2,7 @@
  * x11_timer.h: helper class to implement timers
  *****************************************************************************
  * 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>
  *
@@ -71,7 +71,7 @@ class X11TimerManager
         timer_thread_t *_p_timer;
         list<X11Timer*> _timers;
         vlc_mutex_t _lock;
-        
+
         X11TimerManager( intf_thread_t *p_intf );
         ~X11TimerManager();
 
@@ -79,6 +79,7 @@ class X11TimerManager
         void WaitNextTimer();
 
     public:
+        static void Initialize();
         static X11TimerManager *Instance( intf_thread_t *p_intf );
         void Destroy();
 
index bc8479a8a8fbefbce3e79fccf9f5822def1f5fb9..c26332c711ea132c1287727cbfa0564c80cc148c 100644 (file)
@@ -2,7 +2,7 @@
  * dialogs.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * 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>
  *
@@ -329,6 +329,5 @@ void DialogsProvider::OnPopupMenu( wxCommandEvent& event )
 
 void DialogsProvider::OnExitThread( wxCommandEvent& WXUNUSED(event) )
 {
-    delete this;
     wxTheApp->ExitMainLoop();
 }
index 7159b388dab0fd9dc0459adc877e6b111157350b..6827540b3181a821b97faf47b70c88deda802c52 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * 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>
  *
@@ -162,8 +162,6 @@ static void Close( vlc_object_t *p_this )
         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 )
     {
         /* We must destroy the dialogs thread */
@@ -172,6 +170,8 @@ static void Close( vlc_object_t *p_this )
         vlc_thread_join( p_intf );
     }
 
+    msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
+
     /* Destroy structure */
     free( p_intf->p_sys );
 }
@@ -229,6 +229,12 @@ static void Init( intf_thread_t *p_intf )
 #else
     wxEntry( i_args, p_args );
 #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 */