From dd533baad22f5143c093b98e98463a0dc62899ea Mon Sep 17 00:00:00 2001 From: tsepez Date: Thu, 19 Jan 2017 06:56:13 -0800 Subject: use unique_ptr in fpdf_font_cid.cpp Also return CFX_MaybeOwned<> from functions so to make cleanup automatic, avoiding a theoretical leak. Review-Url: https://codereview.chromium.org/2641853004 --- core/fpdfapi/font/cpdf_cidfont.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/fpdfapi/font/cpdf_cidfont.h') diff --git a/core/fpdfapi/font/cpdf_cidfont.h b/core/fpdfapi/font/cpdf_cidfont.h index ae3be3908f..79ec7cbb35 100644 --- a/core/fpdfapi/font/cpdf_cidfont.h +++ b/core/fpdfapi/font/cpdf_cidfont.h @@ -11,6 +11,7 @@ #include #include "core/fpdfapi/font/cpdf_font.h" +#include "core/fxcrt/cfx_maybe_owned.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" @@ -71,8 +72,7 @@ class CPDF_CIDFont : public CPDF_Font { void LoadSubstFont(); FX_WCHAR GetUnicodeFromCharCode(uint32_t charcode) const; - CPDF_CMap* m_pCMap; - std::unique_ptr m_pAllocatedCMap; + CFX_MaybeOwned m_pCMap; CPDF_CID2UnicodeMap* m_pCID2UnicodeMap; CIDSet m_Charset; bool m_bType1; -- cgit v1.2.3