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

Unified Diff: core/src/fxge/ge/fx_ge_font.cpp

Issue 1297713003: Don't bother checking pointers before delete[] and FX_Free(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 4 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_main.cpp ('k') | core/src/fxge/ge/fx_ge_fontmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxge/ge/fx_ge_font.cpp
diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp
index e701ee94923f27439f2c08010f27a2e185d7b144..8be177ed14c48bb9bcfa5b67ecdba9c26dfd465f 100644
--- a/core/src/fxge/ge/fx_ge_font.cpp
+++ b/core/src/fxge/ge/fx_ge_font.cpp
@@ -30,10 +30,8 @@ CFX_Font::CFX_Font() {
CFX_Font::~CFX_Font() {
delete m_pSubstFont;
m_pSubstFont = NULL;
- if (m_pFontDataAllocation) {
- FX_Free(m_pFontDataAllocation);
- m_pFontDataAllocation = NULL;
- }
+ FX_Free(m_pFontDataAllocation);
+ m_pFontDataAllocation = NULL;
if (m_Face) {
if (FXFT_Get_Face_External_Stream(m_Face)) {
FXFT_Clear_Face_External_Stream(m_Face);
@@ -44,14 +42,10 @@ CFX_Font::~CFX_Font() {
CFX_GEModule::Get()->GetFontMgr()->ReleaseFace(m_Face);
}
}
- if (m_pOwnedStream) {
- FX_Free(m_pOwnedStream);
- m_pOwnedStream = NULL;
- }
- if (m_pGsubData) {
- FX_Free(m_pGsubData);
- m_pGsubData = NULL;
- }
+ FX_Free(m_pOwnedStream);
+ m_pOwnedStream = NULL;
+ FX_Free(m_pGsubData);
+ m_pGsubData = NULL;
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
ReleasePlatformResource();
#endif
« no previous file with comments | « core/src/fxge/dib/fx_dib_main.cpp ('k') | core/src/fxge/ge/fx_ge_fontmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698