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

Unified Diff: xfa/fde/css/fde_cssstyleselector.cpp

Issue 1925363002: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 8 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 | « xfa/fde/css/fde_cssstyleselector.h ('k') | xfa/fde/fde_render.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fde/css/fde_cssstyleselector.cpp
diff --git a/xfa/fde/css/fde_cssstyleselector.cpp b/xfa/fde/css/fde_cssstyleselector.cpp
index 8ea85b925733f7448f13ec3d4d3bb88609a949f2..55a1477b4c619ea6d8ece74704cb5153d840116f 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) {
« no previous file with comments | « xfa/fde/css/fde_cssstyleselector.h ('k') | xfa/fde/fde_render.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698