Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Unified Diff: xfa/fwl/theme/cfwl_widgettp.cpp

Issue 1925363002: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/theme/cfwl_scrollbartp.cpp ('k') | xfa/fxbarcode/BC_BufferedImageLuminanceSource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/theme/cfwl_widgettp.cpp
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp
index 7f4e547e24067bdbe12d358ef1455ef6dc7680a9..1ff241636f15c668147984d4f3afb210ab44e5b0 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;
« no previous file with comments | « xfa/fwl/theme/cfwl_scrollbartp.cpp ('k') | xfa/fxbarcode/BC_BufferedImageLuminanceSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698