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

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

Issue 1925363002: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: 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
Index: xfa/fwl/theme/cfwl_checkboxtp.cpp
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp
index ccde6606936692d2b4f13e505dc5071d58871bce..b04d890a6089ba1f4879ab1b5beda6da6e44136d 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -22,21 +22,20 @@
#define CHECKBOX_COLOR_BOXRB1 (ArgbEncode(255, 241, 239, 226))
#define CHECKBOX_COLOR_BOXRB2 (ArgbEncode(255, 255, 255, 255))
-CFWL_CheckBoxTP::CFWL_CheckBoxTP() : m_pCheckPath(NULL) {
- m_pThemeData = new CKBThemeData;
+CFWL_CheckBoxTP::CFWL_CheckBoxTP()
+ : m_pThemeData(new CKBThemeData), m_pCheckPath(nullptr) {
SetThemeData(0);
}
+
CFWL_CheckBoxTP::~CFWL_CheckBoxTP() {
- if (m_pThemeData) {
- delete m_pThemeData;
- m_pThemeData = NULL;
- }
+ delete m_pThemeData;
if (m_pCheckPath) {
m_pCheckPath->Clear();
delete m_pCheckPath;
- m_pCheckPath = NULL;
+ m_pCheckPath = nullptr;
Tom Sepez 2016/04/28 21:47:22 nit: probably not necessary.
Lei Zhang 2016/04/28 22:31:10 Done.
}
}
+
FX_BOOL CFWL_CheckBoxTP::IsValidWidget(IFWL_Widget* pWidget) {
return pWidget && pWidget->GetClassID() == FWL_CLASSHASH_CheckBox;
}

Powered by Google App Engine
This is Rietveld 408576698