summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_sysfontinfo.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-16 15:33:20 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-16 23:26:47 +0000
commitfe91c6c8211cec39f871d9202556e1957bf81983 (patch)
treeb7e763f7affe4c71de67393fbd320c1fed477e0f /fpdfsdk/fpdf_sysfontinfo.cpp
parent365333552cf67b7c97c4093177e7ed7b43f540ab (diff)
downloadpdfium-fe91c6c8211cec39f871d9202556e1957bf81983.tar.xz
Be skeptical of bare |new|s.
In particular, prefer an explicit .release() call when handing ownership of an object to a caller across a C-API. Change-Id: Ic3784e9d0b2d378a08d388989eaea7c9166bacd1 Reviewed-on: https://pdfium-review.googlesource.com/5470 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_sysfontinfo.cpp')
-rw-r--r--fpdfsdk/fpdf_sysfontinfo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/fpdfsdk/fpdf_sysfontinfo.cpp b/fpdfsdk/fpdf_sysfontinfo.cpp
index 32e573611b..1b98b94358 100644
--- a/fpdfsdk/fpdf_sysfontinfo.cpp
+++ b/fpdfsdk/fpdf_sysfontinfo.cpp
@@ -15,6 +15,7 @@
#include "core/fxge/ifx_systemfontinfo.h"
#include "fpdfsdk/fsdk_define.h"
#include "fpdfsdk/pdfwindow/PWL_FontMap.h"
+#include "third_party/base/ptr_util.h"
static_assert(FXFONT_ANSI_CHARSET == FX_CHARSET_ANSI, "Charset must match");
static_assert(FXFONT_DEFAULT_CHARSET == FX_CHARSET_Default,
@@ -114,8 +115,7 @@ DLLEXPORT void STDCALL FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfoExt) {
return;
CFX_GEModule::Get()->GetFontMgr()->SetSystemFontInfo(
- std::unique_ptr<IFX_SystemFontInfo>(
- new CFX_ExternalFontInfo(pFontInfoExt)));
+ pdfium::MakeUnique<CFX_ExternalFontInfo>(pFontInfoExt));
}
DLLEXPORT const FPDF_CharsetFontMap* STDCALL FPDF_GetDefaultTTFMap() {