diff options
author | thestig <thestig@chromium.org> | 2016-04-28 17:29:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-28 17:29:19 -0700 |
commit | 495bda110a6ea8e7a6fc313ec0232a9ca6e3cfdc (patch) | |
tree | 42abda300274f81009bdb9866e0f7e3f81164726 /xfa/fde/css/fde_cssstyleselector.cpp | |
parent | a31098417852bdf13e693a6e0913e0706cf94098 (diff) | |
download | pdfium-495bda110a6ea8e7a6fc313ec0232a9ca6e3cfdc.tar.xz |
Do not check pointers before deleting them.
XFA edition.
Review-Url: https://codereview.chromium.org/1925363002
Diffstat (limited to 'xfa/fde/css/fde_cssstyleselector.cpp')
-rw-r--r-- | xfa/fde/css/fde_cssstyleselector.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/xfa/fde/css/fde_cssstyleselector.cpp b/xfa/fde/css/fde_cssstyleselector.cpp index 8ea85b9257..55a1477b4c 100644 --- a/xfa/fde/css/fde_cssstyleselector.cpp +++ b/xfa/fde/css/fde_cssstyleselector.cpp @@ -220,18 +220,16 @@ CFDE_CSSStyleSelector::CFDE_CSSStyleSelector() m_ePriorities[FDE_CSSSTYLESHEETPRIORITY_Low] = FDE_CSSSTYLESHEETGROUP_UserAgent; } + CFDE_CSSStyleSelector::~CFDE_CSSStyleSelector() { Reset(); - if (m_pInlineStyleStore != NULL) { + if (m_pInlineStyleStore) m_pInlineStyleStore->Release(); - } - if (m_pFixedStyleStore != NULL) { + if (m_pFixedStyleStore) m_pFixedStyleStore->Release(); - } - if (m_pAccelerator != NULL) { - delete m_pAccelerator; - } + delete m_pAccelerator; } + void CFDE_CSSStyleSelector::SetFontMgr(IFX_FontMgr* pFontMgr) { m_pFontMgr = pFontMgr; } @@ -239,14 +237,14 @@ void CFDE_CSSStyleSelector::SetDefFontSize(FX_FLOAT fFontSize) { ASSERT(fFontSize > 0); m_fDefFontSize = fFontSize; } + CFDE_CSSAccelerator* CFDE_CSSStyleSelector::InitAccelerator() { - if (m_pAccelerator == NULL) { + if (!m_pAccelerator) m_pAccelerator = new CFDE_CSSAccelerator; - ASSERT(m_pAccelerator != NULL); - } m_pAccelerator->Clear(); return m_pAccelerator; } + IFDE_CSSComputedStyle* CFDE_CSSStyleSelector::CreateComputedStyle( IFDE_CSSComputedStyle* pParentStyle) { if (m_pFixedStyleStore == NULL) { |