summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_sysfontinfo.cpp
diff options
context:
space:
mode:
authornpm <npm@chromium.org>2016-11-08 16:48:36 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-08 16:48:36 -0800
commit788217d77c9933614efbd778b6f6ee0008f4f9d9 (patch)
tree6af8d399b736e59971243ac92a594cdb8aaa5297 /fpdfsdk/fpdf_sysfontinfo.cpp
parent28c888b8ee6d1da93cffaa8c14833ddc4986cc79 (diff)
downloadpdfium-788217d77c9933614efbd778b6f6ee0008f4f9d9.tar.xz
Add FPDF_FreeDefaultSystemFontInfo API
Added method that will cast into FPDF_SYSFONTINFO_DEFAULT and delete. This will allow using FPDF_GetDefaultSystemFontInfo() without memory management problems. Review-Url: https://codereview.chromium.org/2485283002
Diffstat (limited to 'fpdfsdk/fpdf_sysfontinfo.cpp')
-rw-r--r--fpdfsdk/fpdf_sysfontinfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_sysfontinfo.cpp b/fpdfsdk/fpdf_sysfontinfo.cpp
index ef62ae3f8a..ac6cf28e0b 100644
--- a/fpdfsdk/fpdf_sysfontinfo.cpp
+++ b/fpdfsdk/fpdf_sysfontinfo.cpp
@@ -194,3 +194,8 @@ DLLEXPORT FPDF_SYSFONTINFO* STDCALL FPDF_GetDefaultSystemFontInfo() {
pFontInfoExt->m_pFontInfo = pFontInfo.release();
return pFontInfoExt;
}
+
+DLLEXPORT void FPDF_FreeDefaultSystemFontInfo(
+ FPDF_SYSFONTINFO* pDefaultFontInfo) {
+ delete static_cast<FPDF_SYSFONTINFO_DEFAULT*>(pDefaultFontInfo);
+}