summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/font')
-rw-r--r--core/fpdfapi/font/fpdf_font.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/fpdfapi/font/fpdf_font.cpp b/core/fpdfapi/font/fpdf_font.cpp
index b681edf70b..c827ea5793 100644
--- a/core/fpdfapi/font/fpdf_font.cpp
+++ b/core/fpdfapi/font/fpdf_font.cpp
@@ -47,8 +47,11 @@ CFX_StockFontArray::CFX_StockFontArray() {}
CFX_StockFontArray::~CFX_StockFontArray() {
for (size_t i = 0; i < FX_ArraySize(m_StockFonts); ++i) {
- if (m_StockFonts[i])
- delete m_StockFonts[i]->GetFontDict();
+ if (!m_StockFonts[i])
+ continue;
+ CPDF_Dictionary* pFontDict = m_StockFonts[i]->GetFontDict();
+ if (pFontDict)
+ pFontDict->Release();
}
}