From f74ad998d2e8d2636fb25e94823946a3b151e34e Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 11 May 2016 10:26:05 -0700 Subject: Replace some calls to Release() with direct delete, part 1. Searching for the anti-pattern: void Release() { delete this; } We must be explicit on the ownership model. Add unique_ptrs as a result. Review-Url: https://codereview.chromium.org/1960673003 --- xfa/fxfa/app/xfa_textlayout.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xfa/fxfa/app/xfa_textlayout.h') diff --git a/xfa/fxfa/app/xfa_textlayout.h b/xfa/fxfa/app/xfa_textlayout.h index 17450ddeab..4d03aee302 100644 --- a/xfa/fxfa/app/xfa_textlayout.h +++ b/xfa/fxfa/app/xfa_textlayout.h @@ -8,6 +8,7 @@ #define XFA_FXFA_APP_XFA_TEXTLAYOUT_H_ #include +#include #include "xfa/fde/css/fde_css.h" #include "xfa/fde/fde_gedevice.h" @@ -79,7 +80,7 @@ class CXFA_TextParseContext : public CFX_Target { class CXFA_TextParser { public: - CXFA_TextParser() : m_pAllocator(NULL), m_pSelector(NULL), m_pUASheet(NULL) {} + CXFA_TextParser(); virtual ~CXFA_TextParser(); void Reset(); void DoParse(CFDE_XMLNode* pXMLContainer, CXFA_TextProvider* pTextProvider); @@ -131,7 +132,7 @@ class CXFA_TextParser { IFDE_CSSStyleSheet* LoadDefaultSheetStyle(); IFDE_CSSComputedStyle* CreateStyle(IFDE_CSSComputedStyle* pParentStyle); IFX_MemoryAllocator* m_pAllocator; - CFDE_CSSStyleSelector* m_pSelector; + std::unique_ptr m_pSelector; IFDE_CSSStyleSheet* m_pUASheet; CFX_MapPtrTemplate m_mapXMLNodeToParseContext; -- cgit v1.2.3