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

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: 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/core/fwl_widgetmgrimp.cpp ('k') | xfa/fwl/theme/cfwl_formtp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ac94c80d6d168bc88af4611a79dfb5064b2ec591 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -22,21 +22,19 @@
#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;
}
}
+
FX_BOOL CFWL_CheckBoxTP::IsValidWidget(IFWL_Widget* pWidget) {
return pWidget && pWidget->GetClassID() == FWL_CLASSHASH_CheckBox;
}
« no previous file with comments | « xfa/fwl/core/fwl_widgetmgrimp.cpp ('k') | xfa/fwl/theme/cfwl_formtp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698