Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Unified Diff: core/src/fxge/dib/fx_dib_main.cpp

Issue 1192743004: Cleanup: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxge/dib/fx_dib_engine.cpp ('k') | core/src/fxge/ge/fx_ge.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxge/dib/fx_dib_main.cpp
diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp
index a148334f3c92be54e5dbb920f4f2042bd8bc773f..82a14974f4ac72a0c7cd153f444c9496105fcdd6 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)
« no previous file with comments | « core/src/fxge/dib/fx_dib_engine.cpp ('k') | core/src/fxge/ge/fx_ge.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698