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/ge | |
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/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 f91953c587..8c2a4378da 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(); } @@ -47,9 +43,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 c9e3e3fe1f..d04f4fd59d 100644 --- a/core/src/fxge/ge/fx_ge_font.cpp +++ b/core/src/fxge/ge/fx_ge_font.cpp @@ -64,10 +64,8 @@ FX_BOOL CFX_Font::LoadClone(const CFX_Font* pFont) } CFX_Font::~CFX_Font() { - if (m_pSubstFont) { - delete m_pSubstFont; - m_pSubstFont = NULL; - } + delete m_pSubstFont; + m_pSubstFont = NULL; if (m_bLogic) { m_OtfFontData.DetachBuffer(); return; diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp index a15f742f38..538da9ae4c 100644 --- a/core/src/fxge/ge/fx_ge_fontmap.cpp +++ b/core/src/fxge/ge/fx_ge_fontmap.cpp @@ -74,9 +74,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 9a3b021b67..6b1f691693 100644 --- a/core/src/fxge/ge/fx_ge_text.cpp +++ b/core/src/fxge/ge/fx_ge_text.cpp @@ -1058,9 +1058,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_ |