summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-20 16:33:30 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-20 16:33:30 -0700
commitced4c2bf1d0d1bab14a6145b35b3baecb175a691 (patch)
tree864cc9992284424365607b330ac218bfb840bf73 /core/src/fpdfapi
parent7a8387e670a2f879b9b2f1fc7bb67064f73fb249 (diff)
downloadpdfium-ced4c2bf1d0d1bab14a6145b35b3baecb175a691.tar.xz
Merge to XFA: Remove Release() combo patch.
Includes: Original Review URL: https://codereview.chromium.org/1098043002 Original Review URL: https://codereview.chromium.org/1097843003 Original Review URL: https://codereview.chromium.org/1093213002 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1092033004
Diffstat (limited to 'core/src/fpdfapi')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page.cpp19
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp3
2 files changed, 6 insertions, 16 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index ccdfb9fcbb..c9b17054a8 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -7,10 +7,6 @@
#include "../../../include/fpdfapi/fpdf_page.h"
#include "../../../include/fpdfapi/fpdf_module.h"
#include "pageint.h"
-void CPDF_PageObject::Release()
-{
- delete this;
-}
CPDF_PageObject* CPDF_PageObject::Create(int type)
{
switch (type) {
@@ -27,6 +23,9 @@ CPDF_PageObject* CPDF_PageObject::Create(int type)
}
return NULL;
}
+CPDF_PageObject::~CPDF_PageObject()
+{
+}
CPDF_PageObject* CPDF_PageObject::Clone() const
{
CPDF_PageObject* pObj = Create(m_Type);
@@ -689,11 +688,7 @@ CPDF_PageObjects::~CPDF_PageObjects()
}
FX_POSITION pos = m_ObjectList.GetHeadPosition();
while (pos) {
- CPDF_PageObject* pPageObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
- if (!pPageObj) {
- continue;
- }
- pPageObj->Release();
+ delete (CPDF_PageObject*)m_ObjectList.GetNext(pos);
}
}
void CPDF_PageObjects::ContinueParse(IFX_Pause* pPause)
@@ -808,11 +803,7 @@ void CPDF_PageObjects::ClearCacheObjects()
if (m_bReleaseMembers) {
FX_POSITION pos = m_ObjectList.GetHeadPosition();
while (pos) {
- CPDF_PageObject* pPageObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
- if (!pPageObj) {
- continue;
- }
- pPageObj->Release();
+ delete (CPDF_PageObject*)m_ObjectList.GetNext(pos);
}
}
m_ObjectList.RemoveAll();
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
index 559d8500b1..612b0e3716 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
@@ -192,8 +192,7 @@ void CPDF_ClipPath::AppendTexts(CPDF_TextObject** pTexts, int count)
CPDF_ClipPathData* pData = GetModify();
if (pData->m_TextCount + count > FPDF_CLIPPATH_MAX_TEXTS) {
for (int i = 0; i < count; i ++) {
- if (pTexts[i])
- pTexts[i]->Release();
+ delete pTexts[i];
}
return;
}