From 9b671ace8aec906683b05399cf8a2882ed8ef7b6 Mon Sep 17 00:00:00 2001 From: weili Date: Mon, 25 Jul 2016 07:40:27 -0700 Subject: Use smart pointers for CFX_Font and CFX_Type3Font classes For the class owned member variables, use std::unique_ptr or std::vector for memory management. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2169793002 --- xfa/fgas/font/fgas_gefont.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xfa/fgas/font') diff --git a/xfa/fgas/font/fgas_gefont.cpp b/xfa/fgas/font/fgas_gefont.cpp index 576f482df2..48635cabf7 100644 --- a/xfa/fgas/font/fgas_gefont.cpp +++ b/xfa/fgas/font/fgas_gefont.cpp @@ -109,7 +109,7 @@ CFGAS_GEFont::CFGAS_GEFont(const CFGAS_GEFont& src, uint32_t dwFontStyles) CFX_SubstFont* pSubst = m_pFont->GetSubstFont(); if (!pSubst) { pSubst = new CFX_SubstFont; - m_pFont->SetSubstFont(pSubst); + m_pFont->SetSubstFont(std::unique_ptr(pSubst)); } pSubst->m_Weight = (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL; -- cgit v1.2.3