summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
Diffstat (limited to 'core/include')
-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;
}