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/fde_render.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/fde_render.h')
-rw-r--r-- | xfa/fde/fde_render.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/xfa/fde/fde_render.h b/xfa/fde/fde_render.h index c28b4abd16..1a80bce926 100644 --- a/xfa/fde/fde_render.h +++ b/xfa/fde/fde_render.h @@ -7,6 +7,8 @@ #ifndef XFA_FDE_FDE_RENDER_H_ #define XFA_FDE_FDE_RENDER_H_ +#include <memory> + #include "core/fxcrt/include/fx_coordinates.h" #include "xfa/fde/fde_gedevice.h" #include "xfa/fde/fde_iterator.h" @@ -24,9 +26,8 @@ enum FDE_RENDERSTATUS { class CFDE_RenderContext : public CFX_Target { public: CFDE_RenderContext(); - ~CFDE_RenderContext(); + ~CFDE_RenderContext() override; - void Release() { delete this; } FX_BOOL StartRender(CFDE_RenderDevice* pRenderDevice, IFDE_CanvasSet* pCanvasSet, const CFX_Matrix& tmDoc2Device); @@ -42,11 +43,11 @@ class CFDE_RenderContext : public CFX_Target { protected: FDE_RENDERSTATUS m_eStatus; CFDE_RenderDevice* m_pRenderDevice; - CFDE_Brush* m_pBrush; CFX_Matrix m_Transform; FXTEXT_CHARPOS* m_pCharPos; int32_t m_iCharPosCount; - CFDE_VisualSetIterator* m_pIterator; + std::unique_ptr<CFDE_Brush> m_pBrush; + std::unique_ptr<CFDE_VisualSetIterator> m_pIterator; }; #endif // XFA_FDE_FDE_RENDER_H_ |