diff options
author | Lei Zhang <thestig@chromium.org> | 2015-06-19 17:26:17 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-06-19 17:26:17 -0700 |
commit | 6d8b1c2c7b1cbada20109f70ae971a4192330bb5 (patch) | |
tree | e755b7cb2624622cba606134493d25fb7f1ce6c8 /core/src/fxge/dib | |
parent | 9883a7da2d4f31910073c03e703d5b97a45d9254 (diff) | |
download | pdfium-6d8b1c2c7b1cbada20109f70ae971a4192330bb5.tar.xz |
Merge to XFA: Cleanup: Do not check pointers before deleting them.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1192743004.
(cherry picked from commit cfac954abcab7caf47d3fa3d641c553cba998271)
Review URL: https://codereview.chromium.org/1196783003.
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 252d26d803..cb3559180f 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 bc5c340f65..74e9c3cfd5 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; @@ -1497,9 +1493,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() { @@ -1508,7 +1502,7 @@ CFX_FilteredDIB::CFX_FilteredDIB() } CFX_FilteredDIB::~CFX_FilteredDIB() { - if (m_pSrc && m_bAutoDropSrc) { + if (m_bAutoDropSrc) { delete m_pSrc; } if (m_pScanline) { @@ -1548,9 +1542,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, @@ -1667,9 +1659,7 @@ CFX_BitmapStorer::CFX_BitmapStorer() } CFX_BitmapStorer::~CFX_BitmapStorer() { - if (m_pBitmap) { - delete m_pBitmap; - } + delete m_pBitmap; } CFX_DIBitmap* CFX_BitmapStorer::Detach() { @@ -1679,9 +1669,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) |