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/ge | |
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/ge')
-rw-r--r-- | core/src/fxge/ge/fx_ge.cpp | 12 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_device.cpp | 8 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_font.cpp | 6 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_fontmap.cpp | 4 | ||||
-rw-r--r-- | core/src/fxge/ge/fx_ge_text.cpp | 4 |
5 files changed, 9 insertions, 25 deletions
diff --git a/core/src/fxge/ge/fx_ge.cpp b/core/src/fxge/ge/fx_ge.cpp index 5198a042e8..4b34a079e5 100644 --- a/core/src/fxge/ge/fx_ge.cpp +++ b/core/src/fxge/ge/fx_ge.cpp @@ -17,13 +17,9 @@ CFX_GEModule::CFX_GEModule() } CFX_GEModule::~CFX_GEModule() { - if (m_pFontCache) { - delete m_pFontCache; - } + delete m_pFontCache; m_pFontCache = NULL; - if (m_pFontMgr) { - delete m_pFontMgr; - } + delete m_pFontMgr; m_pFontMgr = NULL; DestroyPlatform(); } @@ -44,9 +40,7 @@ void CFX_GEModule::Use(CFX_GEModule* pModule) } void CFX_GEModule::Destroy() { - if (g_pGEModule) { - delete g_pGEModule; - } + delete g_pGEModule; g_pGEModule = NULL; } CFX_FontCache* CFX_GEModule::GetFontCache() diff --git a/core/src/fxge/ge/fx_ge_device.cpp b/core/src/fxge/ge/fx_ge_device.cpp index b4a4a89595..793dfc5ee2 100644 --- a/core/src/fxge/ge/fx_ge_device.cpp +++ b/core/src/fxge/ge/fx_ge_device.cpp @@ -12,15 +12,11 @@ CFX_RenderDevice::CFX_RenderDevice() } CFX_RenderDevice::~CFX_RenderDevice() { - if (m_pDeviceDriver) { - delete m_pDeviceDriver; - } + delete m_pDeviceDriver; } void CFX_RenderDevice::SetDeviceDriver(IFX_RenderDeviceDriver* pDriver) { - if (m_pDeviceDriver) { - delete m_pDeviceDriver; - } + delete m_pDeviceDriver; m_pDeviceDriver = pDriver; InitDeviceInfo(); } diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp index 8e4e5ac2e3..f88cbaacde 100644 --- a/core/src/fxge/ge/fx_ge_font.cpp +++ b/core/src/fxge/ge/fx_ge_font.cpp @@ -28,10 +28,8 @@ CFX_Font::CFX_Font() } CFX_Font::~CFX_Font() { - if (m_pSubstFont) { - delete m_pSubstFont; - m_pSubstFont = NULL; - } + delete m_pSubstFont; + m_pSubstFont = NULL; if (m_pFontDataAllocation) { FX_Free(m_pFontDataAllocation); m_pFontDataAllocation = NULL; diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp index 8406b3c37b..8956cd1c88 100644 --- a/core/src/fxge/ge/fx_ge_fontmap.cpp +++ b/core/src/fxge/ge/fx_ge_fontmap.cpp @@ -71,9 +71,7 @@ CFX_FontMgr::CFX_FontMgr() } CFX_FontMgr::~CFX_FontMgr() { - if (m_pBuiltinMapper) { - delete m_pBuiltinMapper; - } + delete m_pBuiltinMapper; FreeCache(); if (m_FTLibrary) { FXFT_Done_FreeType(m_FTLibrary); diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp index 7daeecbb8b..b55119b915 100644 --- a/core/src/fxge/ge/fx_ge_text.cpp +++ b/core/src/fxge/ge/fx_ge_text.cpp @@ -1082,9 +1082,7 @@ CFX_FaceCache::~CFX_FaceCache() m_PathMap.GetNextAssoc(pos, key1, (void*&)pPath); delete pPath; } - if (m_pBitmap) { - delete m_pBitmap; - } + delete m_pBitmap; m_PathMap.RemoveAll(); } #if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ |