[vlc-devel] commit: That's safe to delete NULL. ( Rémi Duraffort )
git version control
git at videolan.org
Thu Jul 16 11:09:11 CEST 2009
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Jul 16 10:13:00 2009 +0200| [13761f2a6ded3abe14d1350bc7d3e84b2f022f82] | committer: Rémi Duraffort
That's safe to delete NULL.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=13761f2a6ded3abe14d1350bc7d3e84b2f022f82
---
modules/gui/skins2/controls/ctrl_list.cpp | 10 ++--------
modules/gui/skins2/src/file_bitmap.cpp | 2 +-
modules/gui/skins2/src/ft2_bitmap.cpp | 5 +----
modules/gui/skins2/src/scaled_bitmap.cpp | 5 +----
modules/gui/skins2/utils/ustring.cpp | 5 +----
modules/video_filter/atmo/AtmoConfig.cpp | 6 ++----
6 files changed, 8 insertions(+), 25 deletions(-)
diff --git a/modules/gui/skins2/controls/ctrl_list.cpp b/modules/gui/skins2/controls/ctrl_list.cpp
index 7bf3feb..c0dc427 100644
--- a/modules/gui/skins2/controls/ctrl_list.cpp
+++ b/modules/gui/skins2/controls/ctrl_list.cpp
@@ -65,10 +65,7 @@ CtrlList::~CtrlList()
{
m_rList.getPositionVar().delObserver( this );
m_rList.delObserver( this );
- if( m_pImage )
- {
- delete m_pImage;
- }
+ delete m_pImage;
}
@@ -411,10 +408,7 @@ void CtrlList::autoScroll()
void CtrlList::makeImage()
{
- if( m_pImage )
- {
- delete m_pImage;
- }
+ delete m_pImage;
// Get the size of the control
const Position *pPos = getPosition();
diff --git a/modules/gui/skins2/src/file_bitmap.cpp b/modules/gui/skins2/src/file_bitmap.cpp
index 5ab377d..de23e8d 100644
--- a/modules/gui/skins2/src/file_bitmap.cpp
+++ b/modules/gui/skins2/src/file_bitmap.cpp
@@ -85,7 +85,7 @@ FileBitmap::FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
FileBitmap::~FileBitmap()
{
- if( m_pData ) delete[] m_pData;
+ delete[] m_pData;
}
diff --git a/modules/gui/skins2/src/ft2_bitmap.cpp b/modules/gui/skins2/src/ft2_bitmap.cpp
index 7cc8a84..e743755 100644
--- a/modules/gui/skins2/src/ft2_bitmap.cpp
+++ b/modules/gui/skins2/src/ft2_bitmap.cpp
@@ -36,10 +36,7 @@ FT2Bitmap::FT2Bitmap( intf_thread_t *pIntf, int width, int height ):
FT2Bitmap::~FT2Bitmap()
{
- if( m_pData )
- {
- delete[] m_pData;
- }
+ delete[] m_pData;
}
diff --git a/modules/gui/skins2/src/scaled_bitmap.cpp b/modules/gui/skins2/src/scaled_bitmap.cpp
index 576c96f..0491399 100644
--- a/modules/gui/skins2/src/scaled_bitmap.cpp
+++ b/modules/gui/skins2/src/scaled_bitmap.cpp
@@ -104,9 +104,6 @@ ScaledBitmap::ScaledBitmap( intf_thread_t *pIntf, const GenericBitmap &rBitmap,
ScaledBitmap::~ScaledBitmap()
{
- if( m_pData )
- {
- delete[] m_pData;
- }
+ delete[] m_pData;
}
diff --git a/modules/gui/skins2/utils/ustring.cpp b/modules/gui/skins2/utils/ustring.cpp
index 76fb03c..3f1f869 100644
--- a/modules/gui/skins2/utils/ustring.cpp
+++ b/modules/gui/skins2/utils/ustring.cpp
@@ -130,10 +130,7 @@ UString::UString( intf_thread_t *pIntf, const char *pString ):
UString::~UString()
{
- if( m_pString )
- {
- delete[] m_pString;
- }
+ delete[] m_pString;
}
diff --git a/modules/video_filter/atmo/AtmoConfig.cpp b/modules/video_filter/atmo/AtmoConfig.cpp
index 5e1fdf7..1249beb 100644
--- a/modules/video_filter/atmo/AtmoConfig.cpp
+++ b/modules/video_filter/atmo/AtmoConfig.cpp
@@ -211,8 +211,7 @@ int CAtmoConfig::getNumChannelAssignments() {
void CAtmoConfig::clearChannelMappings() {
for(int i=1;i<10;i++) {
tChannelAssignment *ca = m_ChannelAssignments[i];
- if(ca!=NULL)
- delete ca;
+ delete ca;
m_ChannelAssignments[i] = NULL;
}
}
@@ -220,8 +219,7 @@ void CAtmoConfig::clearChannelMappings() {
void CAtmoConfig::clearAllChannelMappings() {
for(int i=0;i<10;i++) {
tChannelAssignment *ca = m_ChannelAssignments[i];
- if(ca!=NULL)
- delete ca;
+ delete ca;
m_ChannelAssignments[i] = NULL;
}
}
More information about the vlc-devel
mailing list