Commit 7326fad1 authored by ivoire's avatar ivoire
Browse files

One more time removing of some useless tests.

parent cc10207a
......@@ -580,7 +580,7 @@ static int OpenTextRenderer( intf_thread_t *p_intf )
p_intf->p_sys->p_text->p_module =
module_Need( p_intf->p_sys->p_text, "text renderer", 0, 0 );
}
if( psz_modulename ) free( psz_modulename );
free( psz_modulename );
if( !p_intf->p_sys->p_text->p_module )
return VLC_EGENERIC;
......@@ -684,9 +684,12 @@ static picture_t *AllocatePicture( vlc_object_t *p_this,
static void DeAllocatePicture( vlc_object_t *p_this, picture_t *p_pic,
video_format_t *p_fmt )
{
if( p_pic && p_pic->p_data_orig ) free( p_pic->p_data_orig );
if( p_pic && p_pic->pf_release ) p_pic->pf_release( p_pic );
if( p_fmt && p_fmt->p_palette )
if( p_pic )
{
free( p_pic->p_data_orig );
if( p_pic->pf_release ) p_pic->pf_release( p_pic );
}
if( p_fmt )
{
free( p_fmt->p_palette );
p_fmt->p_palette = NULL;
......
......@@ -623,7 +623,7 @@
[self setupVarMenu: o_menu forMenuItem: o_mi target:p_object
var:psz_variable selector:pf_callback];
if( text.psz_string ) free( text.psz_string );
free( text.psz_string );
return;
}
......@@ -645,12 +645,12 @@
break;
default:
if( text.psz_string ) free( text.psz_string );
free( text.psz_string );
return;
}
if( ( i_type & VLC_VAR_TYPE ) == VLC_VAR_STRING ) free( val.psz_string );
if( text.psz_string ) free( text.psz_string );
free( text.psz_string );
}
......
......@@ -416,7 +416,7 @@
- (void)dealloc
{
if( o_label ) [o_label release];
if( psz_name ) free( psz_name );
free( psz_name );
[super dealloc];
}
......
......@@ -343,16 +343,16 @@ static void Close( vlc_object_t *p_this )
for( i = 0; i < p_sys->i_dir_entries; i++ )
{
struct dir_entry_t *p_dir_entry = p_sys->pp_dir_entries[i];
if( p_dir_entry->psz_path ) free( p_dir_entry->psz_path );
free( p_dir_entry->psz_path );
REMOVE_ELEM( p_sys->pp_dir_entries, p_sys->i_dir_entries, i );
if( p_dir_entry ) free( p_dir_entry );
free( p_dir_entry );
}
p_sys->pp_dir_entries = NULL;
if( p_sys->psz_current_dir ) free( p_sys->psz_current_dir );
if( p_sys->psz_search_chain ) free( p_sys->psz_search_chain );
if( p_sys->psz_old_search ) free( p_sys->psz_old_search );
if( p_sys->psz_open_chain ) free( p_sys->psz_open_chain );
free( p_sys->psz_current_dir );
free( p_sys->psz_search_chain );
free( p_sys->psz_old_search );
free( p_sys->psz_open_chain );
if( p_sys->p_input )
{
......@@ -948,11 +948,8 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
break;
}
}
if( p_sys->psz_old_search )
{
free( p_sys->psz_old_search );
p_sys->psz_old_search = NULL;
}
free( p_sys->psz_old_search );
p_sys->psz_old_search = NULL;
SearchPlaylist( p_intf, p_sys->psz_search_chain );
return 1;
}
......@@ -2361,7 +2358,7 @@ static void Eject( intf_thread_t *p_intf )
intf_Eject( p_intf, psz_device );
}
free(psz_device);
free( psz_device );
return;
}
......
......@@ -386,7 +386,7 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
// this, like the one behind the refresh push button?
p_module_config->b_dirty = VLC_FALSE;
if(val.psz_string) free(val.psz_string);
free( val.psz_string );
}
finish( p_module_config, bycat );
......
......@@ -190,6 +190,9 @@ void InteractionDialog::update()
if( ( p_dialog->i_flags & DIALOG_INTF_PROGRESS ) &&
( p_dialog->val.f_float >= 100.0 ) )
progressBar->hide();
if( ( p_dialog->i_flags & DIALOG_USER_PROGRESS ) &&
( p_dialog->val.f_float >= 100.0 ) )
altButton->setText( qtr( "close" ) );
}
InteractionDialog::~InteractionDialog()
......
......@@ -960,7 +960,7 @@ int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
NOTCOMMAND && val.psz_string &&
!strcmp( val.psz_string, CURVAL.psz_string ) );
if( val.psz_string ) free( val.psz_string );
free( val.psz_string );
break;
case VLC_VAR_INTEGER:
......
......@@ -58,9 +58,9 @@ public:
}
virtual ~MenuItemData()
{
if( psz_var ) free( psz_var );
if( ((i_val_type & VLC_VAR_TYPE) == VLC_VAR_STRING)
&& val.psz_string ) free( val.psz_string );
free( psz_var );
if( ( i_val_type & VLC_VAR_TYPE) == VLC_VAR_STRING )
free( val.psz_string );
}
int i_object_id;
int i_val_type;
......
......@@ -114,7 +114,7 @@ bool ThemeLoader::load( const string &fileName )
// Show the windows
pNewTheme->getWindowManager().showAll( true );
}
if( skin_last ) free( skin_last );
free( skin_last );
// The new theme cannot embed a video output yet
VlcProc::instance( getIntf() )->dropVout();
......
......@@ -320,8 +320,8 @@ void DialogsProvider::OnOpenFileGeneric( intf_dialog_args_t *p_arg )
}
free( p_arg->psz_results );
}
if( p_arg->psz_title ) free( p_arg->psz_title );
if( p_arg->psz_extensions ) free( p_arg->psz_extensions );
free( p_arg->psz_title );
free( p_arg->psz_extensions );
free( p_arg );
}
......
......@@ -558,7 +558,7 @@ void CreateMenuItem( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
AppendMenu( hMenu, MF_STRING | MF_POPUP, (UINT)hMenuItem,
_FROMMB(text.psz_string ? text.psz_string : psz_var) );
if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
if( text.psz_string ) free( text.psz_string );
free( text.psz_string );
return;
}
......@@ -585,12 +585,12 @@ void CreateMenuItem( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
break;
default:
if( text.psz_string ) free( text.psz_string );
free( text.psz_string );
return;
}
if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
if( text.psz_string ) free( text.psz_string );
free( text.psz_string );
}
HMENU CreateChoicesMenu( intf_thread_t *p_intf,
......@@ -802,9 +802,9 @@ MenuItemExt::MenuItemExt( intf_thread_t *p_intf, int _id, char *_psz_var,
MenuItemExt::~MenuItemExt()
{
if( psz_var ) free( psz_var );
if( ((i_val_type & VLC_VAR_TYPE) == VLC_VAR_STRING)
&& val.psz_string ) free( val.psz_string );
free( psz_var );
if( ( i_val_type & VLC_VAR_TYPE ) == VLC_VAR_STRING )
free( val.psz_string );
};
void MenuItemExt::ClearList( vector<MenuItemExt*> *p_menu_list )
......
......@@ -310,7 +310,7 @@ void OpenDialog::FilePanel( HWND hwnd )
sz_subsfile += psz_subsfile;
subsfile_mrl.push_back( sz_subsfile );
}
if( psz_subsfile ) free( psz_subsfile );
free( psz_subsfile );
}
void OpenDialog::NetPanel( HWND hwnd )
......
......@@ -128,9 +128,9 @@ public:
ConfigTreeData() { b_submodule = 0; panel = NULL; psz_section = NULL;
psz_help = NULL; }
virtual ~ConfigTreeData() { if( panel ) delete panel;
if( psz_section) free(psz_section);
if( psz_help) free(psz_help); }
virtual ~ConfigTreeData() { delete panel;
free( psz_section );
free( psz_help ); }
vlc_bool_t b_submodule;
......
......@@ -116,7 +116,7 @@ LRESULT SubsFileDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
10, 10 + 15 + 10 - 3, rcClient.right - 2*10, 5*15 + 6,
hwnd, NULL, hInst, NULL );
if( psz_subsfile ) free( psz_subsfile );
free( psz_subsfile );
browse_button = CreateWindow( _T("BUTTON"), _T("Browse..."),
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
......
......@@ -427,8 +427,8 @@ void DialogsProvider::OnOpenFileGeneric( wxCommandEvent& event )
}
free( p_arg->psz_results );
}
if( p_arg->psz_title ) free( p_arg->psz_title );
if( p_arg->psz_extensions ) free( p_arg->psz_extensions );
free( p_arg->psz_title );
free( p_arg->psz_extensions );
free( p_arg );
}
......
......@@ -118,7 +118,7 @@ BookmarkEditDialog::~BookmarkEditDialog()
}
void BookmarkEditDialog::OnOK( wxCommandEvent &event )
{
if( p_seekpoint->psz_name ) free( p_seekpoint->psz_name );
free( p_seekpoint->psz_name );
p_seekpoint->psz_name = strdup( name_text->GetValue().mb_str(wxConvUTF8) );
p_seekpoint->i_byte_offset = atoi( bytes_text->GetValue().mb_str(wxConvUTF8) );
p_seekpoint->i_time_offset = 1000000 *
......
......@@ -444,7 +444,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
sout_button->Enable();
subsfile_mrl.Add( wxString(wxT("sout=")) + wxL2U(psz_sout) );
}
if( psz_sout ) free( psz_sout );
free( psz_sout );
common_opt_sizer->Add( sout_button, 1, wxALIGN_LEFT |
wxALIGN_CENTER_VERTICAL );
......@@ -661,7 +661,7 @@ wxPanel *OpenDialog::FilePanel( wxWindow* parent )
0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
subfile_combo = new wxComboBox( panel, SubFileName_Event,
wxL2U( psz_subsfile ) );
if( psz_subsfile ) free( psz_subsfile );
free( psz_subsfile );
subbrowse_button = new wxButton( panel, SubFileBrowse_Event,
wxU(_("Browse...")) );
subfile_sizer->Add( subfile_combo, 1, wxALL | wxALIGN_CENTER_VERTICAL, 5 );
......@@ -1632,7 +1632,7 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) )
break;
}
free(psz_device);
free( psz_device );
disc_probe->SetValue(FALSE);
UpdateMRL( DISC_ACCESS );
......@@ -1746,7 +1746,7 @@ void OpenDialog::OnDiscTypeChange( wxCommandEvent& WXUNUSED(event) )
disc_title->SetValue( 0 ); i_disc_title = 0;
disc_chapter->SetValue( 0 ); i_disc_chapter = 0;
if( psz_device ) free( psz_device );
free( psz_device );
UpdateMRL( DISC_ACCESS );
}
......
......@@ -124,9 +124,9 @@ public:
ConfigTreeData() { b_submodule = 0; panel = NULL; psz_name = NULL;
psz_help = NULL; }
virtual ~ConfigTreeData() {
if( panel ) delete panel;
if( psz_name ) free( psz_name );
if( psz_help ) free( psz_help );
delete panel;
free( psz_name );
free( psz_help );
};
vlc_bool_t b_submodule;
......@@ -435,10 +435,10 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
GetItemData( current_item );
cd->i_type = TYPE_CATSUBCAT;
cd->i_subcat_id = p_item->value.i;
if( cd->psz_name ) free( cd->psz_name );
free( cd->psz_name );
cd->psz_name = strdup( config_CategoryNameGet(
p_item->value.i ) );
if( cd->psz_help ) free( cd->psz_help );
free( cd->psz_help );
const char *psz_help = config_CategoryHelpGet( p_item->value.i );
if( psz_help )
{
......
......@@ -579,7 +579,7 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *p_this,
// this, like the one behind the refresh push button?
p_module_config->b_dirty = VLC_FALSE;
if(val.psz_string) free(val.psz_string);
free( val.psz_string );
}
UpdateCombo( p_module_config );
......@@ -601,7 +601,7 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *p_this,
StringListConfigControl::~StringListConfigControl()
{
if( psz_default_value ) free( psz_default_value );
free( psz_default_value );
}
void StringListConfigControl::UpdateCombo( module_config_t *p_item )
......
......@@ -77,7 +77,7 @@ SubsFileDialog::SubsFileDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
if( !psz_subsfile ) psz_subsfile = strdup("");
file_combo = new wxComboBox( panel, -1, wxL2U(psz_subsfile),
wxPoint(20,25), wxSize(300, -1) );
if( psz_subsfile ) free( psz_subsfile );
free( psz_subsfile );
wxButton *browse_button = new wxButton( panel, FileBrowse_Event,
wxU(_("Browse...")) );
file_sizer->Add( file_combo, 1, wxALL, 5 );
......
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