summaryrefslogtreecommitdiff
path: root/xfa/fwl/theme/cfwl_widgettp.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-04-28 17:29:19 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-28 17:29:19 -0700
commit495bda110a6ea8e7a6fc313ec0232a9ca6e3cfdc (patch)
tree42abda300274f81009bdb9866e0f7e3f81164726 /xfa/fwl/theme/cfwl_widgettp.cpp
parenta31098417852bdf13e693a6e0913e0706cf94098 (diff)
downloadpdfium-495bda110a6ea8e7a6fc313ec0232a9ca6e3cfdc.tar.xz
Do not check pointers before deleting them.
XFA edition. Review-Url: https://codereview.chromium.org/1925363002
Diffstat (limited to 'xfa/fwl/theme/cfwl_widgettp.cpp')
-rw-r--r--xfa/fwl/theme/cfwl_widgettp.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp
index 7f4e547e24..1ff241636f 100644
--- a/xfa/fwl/theme/cfwl_widgettp.cpp
+++ b/xfa/fwl/theme/cfwl_widgettp.cpp
@@ -741,27 +741,26 @@ uint32_t FWL_GetThemeColor(uint32_t dwThemeID) {
}
CFWL_ArrowData* CFWL_ArrowData::m_pInstance = NULL;
+
CFWL_ArrowData* CFWL_ArrowData::GetInstance() {
- if (!m_pInstance) {
+ if (!m_pInstance)
m_pInstance = new CFWL_ArrowData;
- }
return m_pInstance;
}
+
FX_BOOL CFWL_ArrowData::IsInstance() {
- return (m_pInstance != NULL);
+ return !!m_pInstance;
}
+
void CFWL_ArrowData::DestroyInstance() {
- if (m_pInstance) {
- delete m_pInstance;
- m_pInstance = NULL;
- }
+ delete m_pInstance;
+ m_pInstance = nullptr;
}
+
CFWL_ArrowData::~CFWL_ArrowData() {
- if (m_pColorData) {
- delete m_pColorData;
- m_pColorData = NULL;
- }
+ delete m_pColorData;
}
+
void CFWL_ArrowData::SetColorData(uint32_t dwID) {
if (!m_pColorData) {
m_pColorData = new CColorData;