mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-04 23:36:00 +02:00
Remove unnecessary delete statements
If a value is null, the C++ delete statement will do nothing, so there is bo need to explicitly check if the value is null.
This commit is contained in:
parent
43187e233a
commit
5f3329e121
12 changed files with 22 additions and 41 deletions
|
@ -13,8 +13,7 @@ FileHandleStream::FileHandleStream()
|
|||
|
||||
FileHandleStream::~FileHandleStream()
|
||||
{
|
||||
if (mCacheBuffer != NULL)
|
||||
delete mCacheBuffer;
|
||||
delete mCacheBuffer;
|
||||
if (mFileHandle != NULL)
|
||||
::CloseHandle_File(mFileHandle);
|
||||
}
|
||||
|
|
|
@ -16,8 +16,7 @@ FileStream::FileStream()
|
|||
|
||||
FileStream::~FileStream()
|
||||
{
|
||||
if (mCacheBuffer != NULL)
|
||||
delete mCacheBuffer;
|
||||
delete mCacheBuffer;
|
||||
if (mFP != NULL)
|
||||
fclose(mFP);
|
||||
}
|
||||
|
|
|
@ -176,8 +176,7 @@ PSDReader::PSDReader()
|
|||
|
||||
PSDReader::~PSDReader()
|
||||
{
|
||||
if (mFS != NULL)
|
||||
delete mFS;
|
||||
delete mFS;
|
||||
for (int i = 0; i < (int) mPSDLayerInfoVector.size(); i++)
|
||||
delete mPSDLayerInfoVector[i];
|
||||
PSDPatternMap::iterator itr = mPSDPatternMap.begin();
|
||||
|
|
|
@ -417,11 +417,10 @@ void DSoundManager::ReleaseSounds()
|
|||
void DSoundManager::ReleaseChannels()
|
||||
{
|
||||
for (int i = 0; i < MAX_CHANNELS; i++)
|
||||
if (mPlayingSounds[i] != NULL)
|
||||
{
|
||||
delete mPlayingSounds[i];
|
||||
mPlayingSounds[i] = NULL;
|
||||
}
|
||||
{
|
||||
delete mPlayingSounds[i];
|
||||
mPlayingSounds[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void DSoundManager::ReleaseFreeChannels()
|
||||
|
|
|
@ -31,11 +31,8 @@ BSpline2D::~BSpline2D()
|
|||
|
||||
void BSpline2D::AddPt(float x, float y)
|
||||
{
|
||||
if (mUVals != NULL)
|
||||
{
|
||||
delete mUVals;
|
||||
mUVals = NULL;
|
||||
}
|
||||
delete mUVals;
|
||||
mUVals = NULL;
|
||||
|
||||
Point2D pt;
|
||||
pt.mX = x;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue