]> git.sesse.net Git - vlc/commitdiff
* modules/gui/skins/win32/win32_run.cpp: don't forget to delete VlcProc
authorGildas Bazin <gbazin@videolan.org>
Wed, 15 Oct 2003 12:24:14 +0000 (12:24 +0000)
committerGildas Bazin <gbazin@videolan.org>
Wed, 15 Oct 2003 12:24:14 +0000 (12:24 +0000)
* modules/gui/wxwindows/*, modules/gui/wxwindows/*: don't forget to delete all our variables callbacks.
* modules/gui/wxwindows/dialogs.cpp: don't delete the dialogs provider twice.
* modules/gui/wxwindows/menus.cpp: small cosmetic changes.

modules/gui/skins/src/dialogs.cpp
modules/gui/skins/src/skin_main.cpp
modules/gui/skins/src/vlcproc.cpp
modules/gui/skins/win32/win32_run.cpp
modules/gui/wxwindows/dialogs.cpp
modules/gui/wxwindows/menus.cpp
modules/gui/wxwindows/timer.cpp
modules/gui/wxwindows/wxwindows.cpp

index cfd6a1bca7b1bb75e3b2b3467ecfe5e41f6987bc..fddd66cd30cede65406ecb3678bed1f7cefb3c2a 100644 (file)
@@ -2,7 +2,7 @@
  * dialogs.cpp: Handles all the different dialog boxes we provide.
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: dialogs.cpp,v 1.15 2003/10/14 22:41:41 gbazin Exp $
+ * $Id: dialogs.cpp,v 1.16 2003/10/15 12:24:14 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -101,6 +101,17 @@ Dialogs::~Dialogs()
         module_Unneed( p_provider, p_module );
         vlc_object_destroy( p_provider );
     }
+
+    /* Unregister callbacks */
+    playlist_t *p_playlist =
+        (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+                                       FIND_ANYWHERE );
+    if( p_playlist != NULL )
+    {
+        var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB,
+                         p_intf->p_sys->p_dialogs );
+        vlc_object_release( p_playlist );
+    }
 }
 
 void Dialogs::ShowOpen( bool b_play )
index a780ec84ba64773ef1c1838594d8b703fc78a2f8..2a885e1c436611e41a223dc7e0588d83cd586385 100644 (file)
@@ -2,7 +2,7 @@
  * skin-main.cpp: skins plugin for VLC
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: skin_main.cpp,v 1.48 2003/10/14 22:41:41 gbazin Exp $
+ * $Id: skin_main.cpp,v 1.49 2003/10/15 12:24:14 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
 //---------------------------------------------------------------------------
 intf_thread_t *g_pIntf;
 
-//---------------------------------------------------------------------------
-// Exported interface functions.
-//---------------------------------------------------------------------------
-#ifdef WIN32
-extern "C" __declspec( dllexport )
-    int __VLC_SYMBOL( vlc_entry ) ( module_t *p_module );
-#endif
-
 //---------------------------------------------------------------------------
 // Local prototypes.
 //---------------------------------------------------------------------------
index 8b007a75d7a8ada98a2e6b9fbcac8b672fe738b7..45e563473261f45bea6c5bc4d122679d48d3929a 100644 (file)
@@ -2,7 +2,7 @@
  * vlcproc.cpp: VlcProc class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: vlcproc.cpp,v 1.44 2003/09/05 15:55:30 asmax Exp $
+ * $Id: vlcproc.cpp,v 1.45 2003/10/15 12:24:14 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -52,7 +52,7 @@ VlcProc::VlcProc( intf_thread_t *_p_intf )
         VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
     if( p_playlist != NULL )
     {
-        // We want to be noticed of playlit changes
+        // We want to be notified of playlit changes
         var_AddCallback( p_playlist, "intf-change", RefreshCallback, this );
 
         // Raise/lower interface with middle click on vout
@@ -70,6 +70,7 @@ VlcProc::~VlcProc()
     if( p_playlist != NULL )
     {
         var_DelCallback( p_playlist, "intf-change", RefreshCallback, this );
+        var_DelCallback( p_playlist, "intf-show", IntfShowCallback, this );
         vlc_object_release( p_playlist );
     }
 }
index dac8181e98a4b82a2c0e6692f8436260534028bd..4c63d601df7f5c9a025a5ffd5d6eb09fa938f3e5 100644 (file)
@@ -2,7 +2,7 @@
  * win32_run.cpp:
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: win32_run.cpp,v 1.20 2003/06/22 12:46:49 asmax Exp $
+ * $Id: win32_run.cpp,v 1.21 2003/10/15 12:24:14 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -185,6 +185,9 @@ void OSRun( intf_thread_t *p_intf )
         // Check if vlc is closing
         Proc->IsClosing();
     }
+
+    /* Cleanup */
+    delete Proc;
 }
 //---------------------------------------------------------------------------
 bool IsVLCEvent( unsigned int msg )
index 3f90bf855aaa3d365542a24f5de0e4067ba764af..59bfe74887a319ef02d5e7656f46d75ad5f2fecd 100644 (file)
@@ -2,7 +2,7 @@
  * dialogs.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: dialogs.cpp,v 1.8 2003/08/28 15:59:03 gbazin Exp $
+ * $Id: dialogs.cpp,v 1.9 2003/10/15 12:24:14 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -106,6 +106,12 @@ DialogsProvider::~DialogsProvider()
     if( p_file_generic_dialog ) delete p_file_generic_dialog;
 
     if( p_intf->p_sys->p_icon ) delete p_intf->p_sys->p_icon;
+
+    /* We must set this here because on win32 this destructor will be
+     * automatically called so we must not call it again on wxApp->OnExit().
+     * There shouldn't be any race conditions as all this should be done
+     * from the same thread. */
+    p_intf->p_sys->p_wxwindow = NULL;
 }
 
 void DialogsProvider::OnIdle( wxIdleEvent& WXUNUSED(event) )
index 22ab1450585ab54178b1976c2bdd2704539009b3..7c7412424b5cb7f3bfb82547bdc5209997f98585 100644 (file)
@@ -2,7 +2,7 @@
  * menus.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: menus.cpp,v 1.21 2003/10/14 22:41:41 gbazin Exp $
+ * $Id: menus.cpp,v 1.22 2003/10/15 12:24:14 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -64,7 +64,7 @@ enum
 {
     /* menu items */
     MenuDummy_Event = wxID_HIGHEST + 1000,
-    OpenFileSimple_Event,
+    OpenFileSimple_Event = wxID_HIGHEST + 1100,
     OpenFile_Event,
     OpenDisc_Event,
     OpenNet_Event,
@@ -363,6 +363,7 @@ Menu::Menu( intf_thread_t *_p_intf, wxWindow *p_parent,
             int i_start_id ): wxMenu( )
 {
     vlc_object_t *p_object;
+    vlc_bool_t b_section_empty = VLC_FALSE;
     int i;
 
     /* Initializations */
@@ -374,28 +375,37 @@ Menu::Menu( intf_thread_t *_p_intf, wxWindow *p_parent,
     {
         if( !ppsz_varnames[i] )
         {
+            if( b_section_empty )
+            {
+                Append( MenuDummy_Event + i, wxU(_("Empty")) );
+                Enable( MenuDummy_Event + i, FALSE );
+            }
+
             AppendSeparator();
+            b_section_empty = VLC_TRUE;
             continue;
         }
 
         if( !pi_objects[i] )
         {
             Append( MenuDummy_Event, wxU(ppsz_varnames[i]) );
+            b_section_empty = VLC_FALSE;
             continue;
         }
 
         p_object = (vlc_object_t *)vlc_object_get( p_intf, pi_objects[i] );
         if( p_object == NULL ) continue;
 
+        b_section_empty = VLC_FALSE;
         CreateMenuItem( this, ppsz_varnames[i], p_object );
         vlc_object_release( p_object );
     }
 
     /* Special case for empty menus */
-    if( GetMenuItemCount() == 0 )
+    if( GetMenuItemCount() == 0 || b_section_empty )
     {
-        Append( MenuDummy_Event, wxU(_("Empty")) );
-        Enable( MenuDummy_Event, FALSE );
+        Append( MenuDummy_Event + i, wxU(_("Empty")) );
+        Enable( MenuDummy_Event + i, FALSE );
     }
 }
 
index 5ae906441e406d802c9eae01e10bf890a9fa209d..57e5beb9f7475ea2fe32609205132e3d33ac586e 100644 (file)
@@ -2,7 +2,7 @@
  * timer.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: timer.cpp,v 1.33 2003/10/14 22:41:41 gbazin Exp $
+ * $Id: timer.cpp,v 1.34 2003/10/15 12:24:14 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -67,6 +67,15 @@ Timer::Timer( intf_thread_t *_p_intf, Interface *_p_main_interface )
 
 Timer::~Timer()
 {
+    /* Unregister callback */
+    playlist_t *p_playlist =
+        (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+                                       FIND_ANYWHERE );
+    if( p_playlist != NULL )
+    {
+        var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
+        vlc_object_release( p_playlist );
+    }
 }
 
 /*****************************************************************************
index 90c14023b5182a64ff7524f27e282103d4281954..5350c88ae81c0ee3acd133acd0610448c94eb070 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: wxwindows.cpp,v 1.34 2003/10/14 22:41:41 gbazin Exp $
+ * $Id: wxwindows.cpp,v 1.35 2003/10/15 12:24:14 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -271,8 +271,8 @@ bool Instance::OnInit()
 
         /* Show the interface */
         MainInterface->Show( TRUE );
-
         SetTopWindow( MainInterface );
+        MainInterface->Raise();
     }
 
     /* Creates the dialogs provider */