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/fde/tto/fde_textout.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xfa/fde/tto/fde_textout.h') diff --git a/xfa/fde/tto/fde_textout.h b/xfa/fde/tto/fde_textout.h index e3e87a780a..91f03e8d9b 100644 --- a/xfa/fde/tto/fde_textout.h +++ b/xfa/fde/tto/fde_textout.h @@ -7,6 +7,8 @@ #ifndef XFA_FDE_TTO_FDE_TEXTOUT_H_ #define XFA_FDE_TTO_FDE_TEXTOUT_H_ +#include + #include "core/fxge/include/fx_dib.h" #include "core/fxge/include/fx_ge.h" #include "xfa/fde/fde_object.h" @@ -72,9 +74,8 @@ typedef CFX_ObjectMassArrayTemplate CFDE_TTOLineArray; class CFDE_TextOut : public CFX_Target { public: CFDE_TextOut(); - ~CFDE_TextOut(); + ~CFDE_TextOut() override; - void Release() { delete this; } void SetFont(IFX_Font* pFont); void SetFontSize(FX_FLOAT fFontSize); void SetTextColor(FX_ARGB color); @@ -179,7 +180,7 @@ class CFDE_TextOut : public CFX_Target { int32_t m_iTotalLines; FXTEXT_CHARPOS* m_pCharPos; int32_t m_iCharPosSize; - CFDE_RenderDevice* m_pRenderDevice; + std::unique_ptr m_pRenderDevice; CFX_Int32Array m_hotKeys; CFX_RectFArray m_rectArray; }; -- cgit v1.2.3