summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font.cpp14
-rw-r--r--core/src/fpdfdoc/doc_metadata.cpp8
2 files changed, 9 insertions, 13 deletions
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index 91d4010b80..9ee9621849 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -128,14 +128,12 @@ FX_BOOL CPDF_Font::Initialize()
}
CPDF_Font::~CPDF_Font()
{
- if (m_pCharMap) {
- FX_Free(m_pCharMap);
- m_pCharMap = NULL;
- }
- if (m_pToUnicodeMap) {
- delete m_pToUnicodeMap;
- m_pToUnicodeMap = NULL;
- }
+ delete m_pCharMap;
+ m_pCharMap = NULL;
+
+ delete m_pToUnicodeMap;
+ m_pToUnicodeMap = NULL;
+
if (m_pFontFile) {
m_pDocument->GetPageData()->ReleaseFontFileStreamAcc((CPDF_Stream*)m_pFontFile->GetStream());
}
diff --git a/core/src/fpdfdoc/doc_metadata.cpp b/core/src/fpdfdoc/doc_metadata.cpp
index bf55527d62..232f6eea21 100644
--- a/core/src/fpdfdoc/doc_metadata.cpp
+++ b/core/src/fpdfdoc/doc_metadata.cpp
@@ -28,7 +28,7 @@ CPDF_Metadata::CPDF_Metadata()
{
m_pData = FX_Alloc(PDFDOC_METADATA, 1);
CFX_CMapByteStringToPtr *&pStringMap = ((PDFDOC_LPMETADATA)m_pData)->m_pStringMap;
- pStringMap = FX_NEW(CFX_CMapByteStringToPtr);
+ pStringMap = FX_NEW CFX_CMapByteStringToPtr;
if (pStringMap != NULL) {
CFX_ByteString bstr;
for (int i = 0; i < 18; i += 2) {
@@ -41,13 +41,11 @@ CPDF_Metadata::~CPDF_Metadata()
{
FXSYS_assert(m_pData != NULL);
CXML_Element *&p = ((PDFDOC_LPMETADATA)m_pData)->m_pXmlElmnt;
- if (p) {
- delete p;
- }
+ delete p;
CFX_CMapByteStringToPtr *pStringMap = ((PDFDOC_LPMETADATA)m_pData)->m_pStringMap;
if (pStringMap) {
pStringMap->RemoveAll();
- FX_Free(pStringMap);
+ delete pStringMap;
}
FX_Free(m_pData);
}