Commit b4b0a1b6 authored by Rémi Duraffort's avatar Rémi Duraffort

Remove useless test before free and delete.

parent 31927c89
...@@ -249,8 +249,7 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -249,8 +249,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
i = [o_tbl_dataTable selectedRow]; i = [o_tbl_dataTable selectedRow];
if( pp_bookmarks[i]->psz_name ) free( pp_bookmarks[i]->psz_name );
free( pp_bookmarks[i]->psz_name );
pp_bookmarks[i]->psz_name = strdup([[o_edit_fld_name stringValue] UTF8String]); pp_bookmarks[i]->psz_name = strdup([[o_edit_fld_name stringValue] UTF8String]);
pp_bookmarks[i]->i_byte_offset = [[o_edit_fld_bytes stringValue] intValue]; pp_bookmarks[i]->i_byte_offset = [[o_edit_fld_bytes stringValue] intValue];
......
...@@ -231,7 +231,7 @@ void ReadDirectory(intf_thread_t *p_intf, GtkListStore *p_list, char *psz_dir ) ...@@ -231,7 +231,7 @@ void ReadDirectory(intf_thread_t *p_intf, GtkListStore *p_list, char *psz_dir )
4, ppsz_text[3], 4, ppsz_text[3],
-1); -1);
if (ppsz_text[1]) free(ppsz_text[1]); free(ppsz_text[1]);
} }
/* kludge */ /* kludge */
for (i=0; i<n; i++) for (i=0; i<n; i++)
...@@ -260,7 +260,7 @@ void ReadDirectory(intf_thread_t *p_intf, GtkListStore *p_list, char *psz_dir ) ...@@ -260,7 +260,7 @@ void ReadDirectory(intf_thread_t *p_intf, GtkListStore *p_list, char *psz_dir )
4, ppsz_text[3], 4, ppsz_text[3],
-1); -1);
if (ppsz_text[1]) free(ppsz_text[1]); free(ppsz_text[1]);
} }
} }
free(pp_namelist); free(pp_namelist);
......
...@@ -54,10 +54,7 @@ FT2Font::~FT2Font() ...@@ -54,10 +54,7 @@ FT2Font::~FT2Font()
{ {
FT_Done_FreeType( m_lib ); FT_Done_FreeType( m_lib );
} }
if( m_buffer ) free( m_buffer );
{
free( m_buffer );
}
} }
......
...@@ -246,10 +246,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -246,10 +246,7 @@ static void Run( intf_thread_t *p_intf )
} }
delete pLoader; delete pLoader;
if( skin_last ) free( skin_last );
{
free( skin_last );
}
// Get the instance of OSLoop // Get the instance of OSLoop
OSLoop *loop = OSFactory::instance( p_intf )->getOSLoop(); OSLoop *loop = OSFactory::instance( p_intf )->getOSLoop();
......
...@@ -75,7 +75,7 @@ woven in by Terry Thorsen 1/2003. ...@@ -75,7 +75,7 @@ woven in by Terry Thorsen 1/2003.
# define ALLOC(size) (malloc(size)) # define ALLOC(size) (malloc(size))
#endif #endif
#ifndef TRYFREE #ifndef TRYFREE
# define TRYFREE(p) {if (p) free(p);} # define TRYFREE(p) {free(p);}
#endif #endif
#define SIZECENTRALDIRITEM (0x2e) #define SIZECENTRALDIRITEM (0x2e)
......
...@@ -118,11 +118,11 @@ DialogsProvider::DialogsProvider( intf_thread_t *p_intf, ...@@ -118,11 +118,11 @@ DialogsProvider::DialogsProvider( intf_thread_t *p_intf,
DialogsProvider::~DialogsProvider() DialogsProvider::~DialogsProvider()
{ {
/* Clean up */ /* Clean up */
if( p_open_dialog ) delete p_open_dialog; delete p_open_dialog;
if( p_playlist_dialog ) delete p_playlist_dialog; delete p_playlist_dialog;
if( p_messages_dialog ) delete p_messages_dialog; delete p_messages_dialog;
if( p_fileinfo_dialog ) delete p_fileinfo_dialog; delete p_fileinfo_dialog;
if( p_prefs_dialog ) delete p_prefs_dialog; delete p_prefs_dialog;
if( h_gsgetfile_dll ) FreeLibrary( h_gsgetfile_dll ); if( h_gsgetfile_dll ) FreeLibrary( h_gsgetfile_dll );
} }
......
...@@ -264,22 +264,22 @@ DialogsProvider::~DialogsProvider() ...@@ -264,22 +264,22 @@ DialogsProvider::~DialogsProvider()
PopEventHandler(true); PopEventHandler(true);
/* Clean up */ /* Clean up */
if( p_open_dialog ) delete p_open_dialog; delete p_open_dialog;
if( p_prefs_dialog ) p_prefs_dialog->Destroy(); if( p_prefs_dialog ) p_prefs_dialog->Destroy();
if( p_file_dialog ) delete p_file_dialog; delete p_file_dialog;
if( p_playlist_dialog ) delete p_playlist_dialog; delete p_playlist_dialog;
if( p_messages_dialog ) delete p_messages_dialog; delete p_messages_dialog;
if( p_fileinfo_dialog ) delete p_fileinfo_dialog; delete p_fileinfo_dialog;
if( p_file_generic_dialog ) delete p_file_generic_dialog; delete p_file_generic_dialog;
if( p_wizard_dialog ) delete p_wizard_dialog; delete p_wizard_dialog;
if( p_bookmarks_dialog ) delete p_bookmarks_dialog; delete p_bookmarks_dialog;
#ifdef UPDATE_CHECK #ifdef UPDATE_CHECK
if( p_updatevlc_dialog ) delete p_updatevlc_dialog; delete p_updatevlc_dialog;
#endif #endif
//if( p_vlm_dialog ) delete p_vlm_dialog; //delete p_vlm_dialog;
if( p_intf->p_sys->p_icon ) delete 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 /* We must set this here because on win32 this destructor will be
* automatically called so we must not call it again on wxApp->OnExit(). * automatically called so we must not call it again on wxApp->OnExit().
......
...@@ -588,9 +588,9 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, ...@@ -588,9 +588,9 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
OpenDialog::~OpenDialog() OpenDialog::~OpenDialog()
{ {
/* Clean up */ /* Clean up */
if( file_dialog ) delete file_dialog; delete file_dialog;
if( sout_dialog ) delete sout_dialog; delete sout_dialog;
if( subsfile_dialog ) delete subsfile_dialog; delete subsfile_dialog;
} }
int OpenDialog::Show( int i_access_method, int i_arg ) int OpenDialog::Show( int i_access_method, int i_arg )
......
...@@ -539,8 +539,7 @@ void Playlist::UpdateTreeItem( wxTreeItemId item ) ...@@ -539,8 +539,7 @@ void Playlist::UpdateTreeItem( wxTreeItemId item )
msg = wxString(wxU( psz_artist )) + wxT(" - ") + msg = wxString(wxU( psz_artist )) + wxT(" - ") +
wxString(wxU(psz_name)) + duration; wxString(wxU(psz_name)) + duration;
} }
if( psz_artist ) free( psz_artist );
free( psz_artist );
free( psz_name ); free( psz_name );
treectrl->SetItemText( item , msg ); treectrl->SetItemText( item , msg );
treectrl->SetItemImage( item, p_item->p_input->i_type ); treectrl->SetItemImage( item, p_item->p_input->i_type );
......
...@@ -357,7 +357,7 @@ wxPanel *ExtraPanel::VideoPanel( wxWindow *parent ) ...@@ -357,7 +357,7 @@ wxPanel *ExtraPanel::VideoPanel( wxWindow *parent )
hue_slider->Disable(); hue_slider->Disable();
gamma_slider->Disable(); gamma_slider->Disable();
} }
if( psz_filters ) free( psz_filters ); free( psz_filters );
int i_value = config_GetInt( p_intf, "hue" ); int i_value = config_GetInt( p_intf, "hue" );
if( i_value > 0 && i_value < 360 ) if( i_value > 0 && i_value < 360 )
......
...@@ -222,11 +222,8 @@ static void Run( intf_thread_t *p_intf ) ...@@ -222,11 +222,8 @@ static void Run( intf_thread_t *p_intf )
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
continue; continue;
} }
if( psz_display ) free( psz_display );
{ psz_display = NULL;
free( psz_display );
psz_display = NULL;
}
if( p_playlist->status.i_status == PLAYLIST_STOPPED ) if( p_playlist->status.i_status == PLAYLIST_STOPPED )
{ {
psz_display = strdup(_("Stop")); psz_display = strdup(_("Stop"));
......
...@@ -129,11 +129,8 @@ static void Deactivate( vlc_object_t *p_this ) ...@@ -129,11 +129,8 @@ static void Deactivate( vlc_object_t *p_this )
# endif # endif
} }
if( p_intf->p_sys ) free( p_intf->p_sys );
{ p_intf->p_sys = NULL;
free( p_intf->p_sys );
p_intf->p_sys = NULL;
}
#endif #endif
} }
......
...@@ -507,8 +507,7 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out, ...@@ -507,8 +507,7 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
static void FreeString( svg_rendition_t *p_svg ) static void FreeString( svg_rendition_t *p_svg )
{ {
if( p_svg->psz_text ) free( p_svg->psz_text );
free( p_svg->psz_text );
/* p_svg->p_rendition is a GdkPixbuf, and its allocation is /* p_svg->p_rendition is a GdkPixbuf, and its allocation is
managed through ref. counting */ managed through ref. counting */
if( p_svg->p_rendition ) if( p_svg->p_rendition )
......
...@@ -150,19 +150,10 @@ static void Close( vlc_object_t * p_this ) ...@@ -150,19 +150,10 @@ static void Close( vlc_object_t * p_this )
for( i = 0; i < p_sys->i_nb_streams; i++ ) for( i = 0; i < p_sys->i_nb_streams; i++ )
{ {
sout_StreamDelete( p_sys->pp_streams[i] ); sout_StreamDelete( p_sys->pp_streams[i] );
if( p_sys->ppsz_select[i] ) free( p_sys->ppsz_select[i] );
{
free( p_sys->ppsz_select[i] );
}
}
if( p_sys->pp_streams )
{
free( p_sys->pp_streams );
}
if( p_sys->ppsz_select )
{
free( p_sys->ppsz_select );
} }
free( p_sys->pp_streams );
free( p_sys->ppsz_select );
free( p_sys ); free( p_sys );
} }
......
...@@ -456,8 +456,7 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id ) ...@@ -456,8 +456,7 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
{ {
if ( pp_ring[i] != NULL ) if ( pp_ring[i] != NULL )
{ {
if ( pp_ring[i]->p_data_orig != NULL ) free( pp_ring[i]->p_data_orig );
free( pp_ring[i]->p_data_orig );
free( pp_ring[i]->p_sys ); free( pp_ring[i]->p_sys );
free( pp_ring[i] ); free( pp_ring[i] );
} }
...@@ -744,8 +743,7 @@ static picture_t *video_new_buffer( vlc_object_t *p_this, ...@@ -744,8 +743,7 @@ static picture_t *video_new_buffer( vlc_object_t *p_this,
{ {
if ( pp_ring[i]->i_status == DESTROYED_PICTURE ) if ( pp_ring[i]->i_status == DESTROYED_PICTURE )
{ {
if ( pp_ring[i]->p_data_orig != NULL ) free( pp_ring[i]->p_data_orig );
free( pp_ring[i]->p_data_orig );
free( pp_ring[i]->p_sys ); free( pp_ring[i]->p_sys );
free( pp_ring[i] ); free( pp_ring[i] );
} }
......
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