diff options
author | tsepez <tsepez@chromium.org> | 2016-05-11 10:26:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-11 10:26:05 -0700 |
commit | f74ad998d2e8d2636fb25e94823946a3b151e34e (patch) | |
tree | 0b18e0a29fdc4bf1cce66ea437d8a4841b3daf4a /xfa/fde/tto/fde_textout.h | |
parent | 2c3a16a7698ba15476173e849f82c97ea3da9939 (diff) | |
download | pdfium-f74ad998d2e8d2636fb25e94823946a3b151e34e.tar.xz |
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
Diffstat (limited to 'xfa/fde/tto/fde_textout.h')
-rw-r--r-- | xfa/fde/tto/fde_textout.h | 7 |
1 files changed, 4 insertions, 3 deletions
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 <memory> + #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_TTOLine> 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<CFDE_RenderDevice> m_pRenderDevice; CFX_Int32Array m_hotKeys; CFX_RectFArray m_rectArray; }; |