diff options
author | Lei Zhang <thestig@chromium.org> | 2015-06-19 14:51:10 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-06-19 14:51:10 -0700 |
commit | cfac954abcab7caf47d3fa3d641c553cba998271 (patch) | |
tree | 4cd546a2377e973fec54b75c1002c8c0ff321e8f /core/src/fxge/dib | |
parent | df558514bf5cb5750d5a7000a843f45f4170d5a4 (diff) | |
download | pdfium-cfac954abcab7caf47d3fa3d641c553cba998271.tar.xz |
Cleanup: Do not check pointers before deleting them.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1192743004.
Diffstat (limited to 'core/src/fxge/dib')
-rw-r--r-- | core/src/fxge/dib/fx_dib_engine.cpp | 4 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_main.cpp | 26 |
2 files changed, 8 insertions, 22 deletions
diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp index 54b9bd9e66..11e9a110cb 100644 --- a/core/src/fxge/dib/fx_dib_engine.cpp +++ b/core/src/fxge/dib/fx_dib_engine.cpp @@ -679,9 +679,7 @@ CFX_ImageStretcher::~CFX_ImageStretcher() if (m_pScanline) { FX_Free(m_pScanline); } - if (m_pStretchEngine) { - delete m_pStretchEngine; - } + delete m_pStretchEngine; if (m_pMaskScanline) { FX_Free(m_pMaskScanline); } diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp index a148334f3c..82a14974f4 100644 --- a/core/src/fxge/dib/fx_dib_main.cpp +++ b/core/src/fxge/dib/fx_dib_main.cpp @@ -48,9 +48,7 @@ CFX_DIBSource::~CFX_DIBSource() if (m_pPalette) { FX_Free(m_pPalette); } - if (m_pAlphaMask) { - delete m_pAlphaMask; - } + delete m_pAlphaMask; } CFX_DIBitmap::CFX_DIBitmap() { @@ -139,9 +137,7 @@ void CFX_DIBitmap::TakeOver(CFX_DIBitmap* pSrcBitmap) if (m_pPalette) { FX_Free(m_pPalette); } - if (m_pAlphaMask) { - delete m_pAlphaMask; - } + delete m_pAlphaMask; m_pBuffer = pSrcBitmap->m_pBuffer; m_pPalette = pSrcBitmap->m_pPalette; m_pAlphaMask = pSrcBitmap->m_pAlphaMask; @@ -1470,9 +1466,7 @@ CFX_DIBExtractor::CFX_DIBExtractor(const CFX_DIBSource* pSrc) } CFX_DIBExtractor::~CFX_DIBExtractor() { - if (m_pBitmap) { - delete m_pBitmap; - } + delete m_pBitmap; } CFX_FilteredDIB::CFX_FilteredDIB() { @@ -1481,7 +1475,7 @@ CFX_FilteredDIB::CFX_FilteredDIB() } CFX_FilteredDIB::~CFX_FilteredDIB() { - if (m_pSrc && m_bAutoDropSrc) { + if (m_bAutoDropSrc) { delete m_pSrc; } if (m_pScanline) { @@ -1521,9 +1515,7 @@ CFX_ImageRenderer::CFX_ImageRenderer() } CFX_ImageRenderer::~CFX_ImageRenderer() { - if (m_pTransformer) { - delete m_pTransformer; - } + delete m_pTransformer; } extern FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, FX_BOOL bFlipX, FX_BOOL bFlipY); FX_BOOL CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn, @@ -1637,9 +1629,7 @@ CFX_BitmapStorer::CFX_BitmapStorer() } CFX_BitmapStorer::~CFX_BitmapStorer() { - if (m_pBitmap) { - delete m_pBitmap; - } + delete m_pBitmap; } CFX_DIBitmap* CFX_BitmapStorer::Detach() { @@ -1649,9 +1639,7 @@ CFX_DIBitmap* CFX_BitmapStorer::Detach() } void CFX_BitmapStorer::Replace(CFX_DIBitmap* pBitmap) { - if (m_pBitmap) { - delete m_pBitmap; - } + delete m_pBitmap; m_pBitmap = pBitmap; } void CFX_BitmapStorer::ComposeScanline(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha) |