Commit 205c1ecf authored by gbazin's avatar gbazin

* modules/gui/skins/win32/win32_run.cpp: don't forget to delete VlcProc

* 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.
parent 28ea8cc2
......@@ -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 )
......
......@@ -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 Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -52,14 +52,6 @@
//---------------------------------------------------------------------------
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.
//---------------------------------------------------------------------------
......
......@@ -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 Teulire <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 );
}
}
......
......@@ -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 Teulire <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 )
......
......@@ -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) )
......
......@@ -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 );
}
}
......
......@@ -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 );
}
}
/*****************************************************************************
......
......@@ -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 */
......
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