diff options
author | thestig <thestig@chromium.org> | 2016-04-28 17:29:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-28 17:29:19 -0700 |
commit | 495bda110a6ea8e7a6fc313ec0232a9ca6e3cfdc (patch) | |
tree | 42abda300274f81009bdb9866e0f7e3f81164726 /xfa/fwl/theme/cfwl_checkboxtp.cpp | |
parent | a31098417852bdf13e693a6e0913e0706cf94098 (diff) | |
download | pdfium-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_checkboxtp.cpp')
-rw-r--r-- | xfa/fwl/theme/cfwl_checkboxtp.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp index ccde660693..ac94c80d6d 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; } |