summaryrefslogtreecommitdiff
path: root/core/include/fxcrt/fx_basic.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-01 22:22:51 -0700
committerLei Zhang <thestig@chromium.org>2015-10-01 22:22:51 -0700
commit78b2a931e4e4ff4dc667bc358560e896601c2f50 (patch)
tree1e62f872065083c0bff0efd4fcf06e3c3f9adefc /core/include/fxcrt/fx_basic.h
parent2852ddc187af249f48b70cc7d22dcaf83fcd9286 (diff)
downloadpdfium-78b2a931e4e4ff4dc667bc358560e896601c2f50.tar.xz
XFA: Remove checks in fxcrt now that new can't return 0.
This is a manual merge. Original review: https://codereview.chromium.org/1052553006 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1384643002 .
Diffstat (limited to 'core/include/fxcrt/fx_basic.h')
-rw-r--r--core/include/fxcrt/fx_basic.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h
index e6b7f69007..62d2a09476 100644
--- a/core/include/fxcrt/fx_basic.h
+++ b/core/include/fxcrt/fx_basic.h
@@ -956,12 +956,8 @@ class CFX_CountRef {
if (m_pObject->m_RefCount <= 0) {
delete m_pObject;
}
- m_pObject = NULL;
}
m_pObject = new CountedObj;
- if (!m_pObject) {
- return NULL;
- }
m_pObject->m_RefCount = 1;
return m_pObject;
}
@@ -1002,17 +998,12 @@ class CFX_CountRef {
ObjClass* GetModify() {
if (m_pObject == NULL) {
m_pObject = new CountedObj;
- if (m_pObject) {
- m_pObject->m_RefCount = 1;
- }
+ m_pObject->m_RefCount = 1;
} else if (m_pObject->m_RefCount > 1) {
m_pObject->m_RefCount--;
CountedObj* pOldObject = m_pObject;
- m_pObject = NULL;
m_pObject = new CountedObj(*pOldObject);
- if (m_pObject) {
- m_pObject->m_RefCount = 1;
- }
+ m_pObject->m_RefCount = 1;
}
return m_pObject;
}