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

Unified Diff: xfa/fwl/theme/cfwl_formtp.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_checkboxtp.cpp ('k') | xfa/fwl/theme/cfwl_pushbuttontp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/theme/cfwl_formtp.cpp
diff --git a/xfa/fwl/theme/cfwl_formtp.cpp b/xfa/fwl/theme/cfwl_formtp.cpp
index ec06f4ad2443c46a05feebbc359a8e443e2e0259..4a18ea0cc40ab41383641f16a94debab8f6d58e9 100644
--- a/xfa/fwl/theme/cfwl_formtp.cpp
+++ b/xfa/fwl/theme/cfwl_formtp.cpp
@@ -35,30 +35,27 @@ CFWL_FormTP::CFWL_FormTP() : m_pActiveBitmap(NULL), m_pDeactivebitmap(NULL) {
m_rtDisBBorder.Reset();
m_rtDisCaption.Reset();
}
+
CFWL_FormTP::~CFWL_FormTP() {
- if (m_pThemeData) {
- delete m_pThemeData;
- m_pThemeData = NULL;
- }
+ delete m_pThemeData;
}
+
FWL_ERR CFWL_FormTP::Initialize() {
InitTTO();
InitCaption(TRUE);
InitCaption(FALSE);
return CFWL_WidgetTP::Initialize();
}
+
FWL_ERR CFWL_FormTP::Finalize() {
FinalizeTTO();
- if (m_pActiveBitmap) {
- delete m_pActiveBitmap;
- m_pActiveBitmap = NULL;
- }
- if (m_pDeactivebitmap) {
- delete m_pDeactivebitmap;
- m_pDeactivebitmap = NULL;
- }
+ delete m_pActiveBitmap;
+ m_pActiveBitmap = nullptr;
+ delete m_pDeactivebitmap;
+ m_pDeactivebitmap = nullptr;
return CFWL_WidgetTP::Finalize();
}
+
FX_BOOL CFWL_FormTP::IsValidWidget(IFWL_Widget* pWidget) {
if (!pWidget)
return FALSE;
@@ -850,10 +847,7 @@ void CFWL_FormTP::InitCaption(FX_BOOL bActive) {
CFX_Graphics gs;
CFX_Path path;
path.Create();
- if (m_pActiveBitmap) {
- delete m_pActiveBitmap;
- m_pActiveBitmap = NULL;
- }
+ delete m_pActiveBitmap;
m_pActiveBitmap = new CFX_DIBitmap;
m_pActiveBitmap->Create(1, FWLTHEME_CAPACITY_CYCaption, FXDIB_Argb);
dev.Attach(m_pActiveBitmap);
@@ -875,10 +869,7 @@ void CFWL_FormTP::InitCaption(FX_BOOL bActive) {
CFX_Graphics gs;
CFX_Path path;
path.Create();
- if (m_pDeactivebitmap) {
- delete m_pDeactivebitmap;
- m_pDeactivebitmap = NULL;
- }
+ delete m_pDeactivebitmap;
m_pDeactivebitmap = new CFX_DIBitmap;
m_pDeactivebitmap->Create(1, FWLTHEME_CAPACITY_CYCaption, FXDIB_Argb);
dev.Attach(m_pDeactivebitmap);
« no previous file with comments | « xfa/fwl/theme/cfwl_checkboxtp.cpp ('k') | xfa/fwl/theme/cfwl_pushbuttontp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698