summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fpdfsdk/fpdf_sysfontinfo.cpp5
-rw-r--r--fpdfsdk/fpdfview_c_api_test.c1
-rw-r--r--public/fpdf_sysfontinfo.h17
3 files changed, 21 insertions, 2 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);
+}
diff --git a/fpdfsdk/fpdfview_c_api_test.c b/fpdfsdk/fpdfview_c_api_test.c
index a48ddb981c..afc357f1e3 100644
--- a/fpdfsdk/fpdfview_c_api_test.c
+++ b/fpdfsdk/fpdfview_c_api_test.c
@@ -158,6 +158,7 @@ int CheckPDFiumCApi() {
CHK(FPDF_AddInstalledFont);
CHK(FPDF_SetSystemFontInfo);
CHK(FPDF_GetDefaultSystemFontInfo);
+ CHK(FPDF_FreeDefaultSystemFontInfo);
// fpdf_text.h
CHK(FPDFText_LoadPage);
diff --git a/public/fpdf_sysfontinfo.h b/public/fpdf_sysfontinfo.h
index c2da74b70b..d75aa19629 100644
--- a/public/fpdf_sysfontinfo.h
+++ b/public/fpdf_sysfontinfo.h
@@ -290,11 +290,24 @@ DLLEXPORT void STDCALL FPDF_SetSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo);
* Pointer to a FPDF_SYSFONTINFO structure describing the default
*interface.
* Or NULL if the platform doesn't have a default interface.
- * Application should call FPDF_FreeMemory to free the returned
- *pointer.
+ * Application should call FPDF_FreeDefaultSystemFontInfo to free the
+ *returned pointer.
**/
DLLEXPORT FPDF_SYSFONTINFO* STDCALL FPDF_GetDefaultSystemFontInfo();
+/**
+ * Function: FPDF_FreeDefaultSystemFontInfo
+ * Free a default system font info interface
+ * Comments:
+ * This function should be called on the output from
+ *FPDF_SetSystemFontInfo once it is no longer needed by the client.
+ * Parameters:
+ * pFontInfo - Pointer to a FPDF_SYSFONTINFO structure
+ * Return Value:
+ * None
+ **/
+DLLEXPORT void FPDF_FreeDefaultSystemFontInfo(FPDF_SYSFONTINFO* pFontInfo);
+
#ifdef __cplusplus
}
#endif