]> git.sesse.net Git - vlc/commitdiff
Remove useless test before free and delete.
authorRémi Duraffort <ivoire@videolan.org>
Sat, 15 Mar 2008 19:01:04 +0000 (20:01 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Sat, 15 Mar 2008 19:02:35 +0000 (20:02 +0100)
15 files changed:
modules/gui/macosx/bookmarks.m
modules/gui/pda/pda_callbacks.c
modules/gui/skins2/src/ft2_font.cpp
modules/gui/skins2/src/skin_main.cpp
modules/gui/skins2/unzip/unzip.c
modules/gui/wince/dialogs.cpp
modules/gui/wxwidgets/dialogs.cpp
modules/gui/wxwidgets/dialogs/open.cpp
modules/gui/wxwidgets/dialogs/playlist.cpp
modules/gui/wxwidgets/extrapanel.cpp
modules/misc/notify/xosd.c
modules/misc/screensaver.c
modules/misc/svg.c
modules/stream_out/duplicate.c
modules/stream_out/mosaic_bridge.c

index 4a2c15c994f76878e2a3ea93fa8332d2de0647cf..69df666e437a4b93a6b30ee612ce6ae500cf6972 100644 (file)
@@ -249,8 +249,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
 
     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]->i_byte_offset = [[o_edit_fld_bytes stringValue] intValue];
index 1685c58411ebf85fc28227ceed075673f88a919f..0ba2b4aca552980ab19bcd80f3d394bed6b4e0b6 100644 (file)
@@ -231,7 +231,7 @@ void ReadDirectory(intf_thread_t *p_intf, GtkListStore *p_list, char *psz_dir )
                                 4, ppsz_text[3],
                                 -1);
 
-            if (ppsz_text[1]) free(ppsz_text[1]);
+            free(ppsz_text[1]);
         }
             /* kludge */
         for (i=0; i<n; i++)
@@ -260,7 +260,7 @@ void ReadDirectory(intf_thread_t *p_intf, GtkListStore *p_list, char *psz_dir )
                                     4, ppsz_text[3],
                                     -1);
 
-                if (ppsz_text[1]) free(ppsz_text[1]);
+                free(ppsz_text[1]);
             }
         }
         free(pp_namelist);
index 42a6a927d52da275331a6f648d5cc9ddd1e6af3e..ab6c7345750016ff93b4b7b4958c41b457e747e6 100644 (file)
@@ -54,10 +54,7 @@ FT2Font::~FT2Font()
     {
         FT_Done_FreeType( m_lib );
     }
-    if( m_buffer )
-    {
-        free( m_buffer );
-    }
+    free( m_buffer );
 }
 
 
index f9072e5a6b1363f95d6b48cd131eff72efd9f704..26c3f17d168a87a3a4d1a29c1f5e39515312eb8c 100644 (file)
@@ -246,10 +246,7 @@ static void Run( intf_thread_t *p_intf )
     }
     delete pLoader;
 
-    if( skin_last )
-    {
-        free( skin_last );
-    }
+    free( skin_last );
 
     // Get the instance of OSLoop
     OSLoop *loop = OSFactory::instance( p_intf )->getOSLoop();
index f9efb750e879fabb95ac8d4af92dd29f1ac0c483..cdb2efd531a5adcbf85d025017f14a4197436344 100644 (file)
@@ -75,7 +75,7 @@ woven in by Terry Thorsen 1/2003.
 # define ALLOC(size) (malloc(size))
 #endif
 #ifndef TRYFREE
-# define TRYFREE(p) {if (p) free(p);}
+# define TRYFREE(p) {free(p);}
 #endif
 
 #define SIZECENTRALDIRITEM (0x2e)
index 83ba42d44252ee95e7317fb80f2154b9cc623d78..ac7027b30a4d7d1548953f5a58c8397179ac3ba3 100644 (file)
@@ -118,11 +118,11 @@ DialogsProvider::DialogsProvider( intf_thread_t *p_intf,
 DialogsProvider::~DialogsProvider()
 {
     /* Clean up */
-    if( p_open_dialog )     delete p_open_dialog;
-    if( p_playlist_dialog ) delete p_playlist_dialog;
-    if( p_messages_dialog ) delete p_messages_dialog;
-    if( p_fileinfo_dialog ) delete p_fileinfo_dialog;
-    if( p_prefs_dialog )    delete p_prefs_dialog;
+    delete p_open_dialog;
+    delete p_playlist_dialog;
+    delete p_messages_dialog;
+    delete p_fileinfo_dialog;
+    delete p_prefs_dialog;
 
     if( h_gsgetfile_dll ) FreeLibrary( h_gsgetfile_dll );
 }
index b62632be84e30a9ed40ca592859eed25931973e0..3b58e794ebda64f37a2dd5a24a210871e949b589 100644 (file)
@@ -264,22 +264,22 @@ DialogsProvider::~DialogsProvider()
     PopEventHandler(true);
 
     /* Clean up */
-    if( p_open_dialog )     delete p_open_dialog;
+    delete p_open_dialog;
     if( p_prefs_dialog )    p_prefs_dialog->Destroy();
-    if( p_file_dialog )     delete p_file_dialog;
-    if( p_playlist_dialog ) delete p_playlist_dialog;
-    if( p_messages_dialog ) delete p_messages_dialog;
-    if( p_fileinfo_dialog ) delete p_fileinfo_dialog;
-    if( p_file_generic_dialog ) delete p_file_generic_dialog;
-    if( p_wizard_dialog ) delete p_wizard_dialog;
-    if( p_bookmarks_dialog ) delete p_bookmarks_dialog;
+    delete p_file_dialog;
+    delete p_playlist_dialog;
+    delete p_messages_dialog;
+    delete p_fileinfo_dialog;
+    delete p_file_generic_dialog;
+    delete p_wizard_dialog;
+    delete p_bookmarks_dialog;
 #ifdef UPDATE_CHECK
-    if( p_updatevlc_dialog ) delete p_updatevlc_dialog;
+    delete p_updatevlc_dialog;
 #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
      * automatically called so we must not call it again on wxApp->OnExit().
index df988e4a8c97927267513c970d80fc998ebad1b6..e487eecebd1f8b7598bd561a13015370b51ccb48 100644 (file)
@@ -588,9 +588,9 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
 OpenDialog::~OpenDialog()
 {
     /* Clean up */
-    if( file_dialog ) delete file_dialog;
-    if( sout_dialog ) delete sout_dialog;
-    if( subsfile_dialog ) delete subsfile_dialog;
+    delete file_dialog;
+    delete sout_dialog;
+    delete subsfile_dialog;
 }
 
 int OpenDialog::Show( int i_access_method, int i_arg )
index bc63d436fd032ffba3d36afaf25ab9ba3d00b7e3..b1fe2476f46ea613417e5ea0958cbca755eaf72a 100644 (file)
@@ -539,8 +539,7 @@ void Playlist::UpdateTreeItem( wxTreeItemId item )
         msg = wxString(wxU( psz_artist )) + wxT(" - ") +
               wxString(wxU(psz_name)) + duration;
     }
-    if( psz_artist )
-        free( psz_artist );
+    free( psz_artist );
     free( psz_name );
     treectrl->SetItemText( item , msg );
     treectrl->SetItemImage( item, p_item->p_input->i_type );
index 77f9b1eedb82c3b2227066858e57116b79c16222..f7bcfd6fc0626d6d6883d88341c96350bb7afec7 100644 (file)
@@ -357,7 +357,7 @@ wxPanel *ExtraPanel::VideoPanel( wxWindow *parent )
         hue_slider->Disable();
         gamma_slider->Disable();
     }
-    if( psz_filters ) free( psz_filters );
+    free( psz_filters );
 
     int i_value = config_GetInt( p_intf, "hue" );
     if( i_value > 0 && i_value < 360 )
index bf5ad459e116cdbf4f4c19a1d3169b8c24fe2cd9..803ab53b1d7f40da5e0898ff2552569acceaf2c6 100644 (file)
@@ -222,11 +222,8 @@ static void Run( intf_thread_t *p_intf )
                 vlc_object_release( p_playlist );
                 continue;
             }
-            if( psz_display )
-            {
-                free( psz_display );
-                psz_display = NULL;
-            }
+            free( psz_display );
+            psz_display = NULL;
             if( p_playlist->status.i_status == PLAYLIST_STOPPED )
             {
                 psz_display = strdup(_("Stop"));
index 80c42ffa26739e66ad836a77be6d61740e7bc474..c090831428017b33d31925b6e1fd87df3538f156 100644 (file)
@@ -129,11 +129,8 @@ static void Deactivate( vlc_object_t *p_this )
 #  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
 }
 
index 7669dc5e13f5728af33d5ff81803c314c8a31bd1..9398c8c4955de165d8fcf5e80279d990dba17bdf 100644 (file)
@@ -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 )
 {
-    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
        managed through ref. counting */
     if( p_svg->p_rendition )
index 3ac8335c67e56ebcce96f3d90c73e6d043b159f4..d923f9efa3a1221e68661bf0ef23897820864853 100644 (file)
@@ -150,19 +150,10 @@ static void Close( vlc_object_t * p_this )
     for( i = 0; i < p_sys->i_nb_streams; i++ )
     {
         sout_StreamDelete( p_sys->pp_streams[i] );
-        if( 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->ppsz_select[i] );
     }
+    free( p_sys->pp_streams );
+    free( p_sys->ppsz_select );
 
     free( p_sys );
 }
index 7ed0f171c5ad380d19603aa42c3b2773effd958a..d9790bc7860bf0a11bff8df2f4c35577aa142627 100644 (file)
@@ -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]->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] );
             }
@@ -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]->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] );
                 }