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

Unified Diff: fpdfsdk/src/pdfwindow/PWL_ListBox.cpp

Issue 1192743004: Cleanup: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 6 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 | « fpdfsdk/src/javascript/app.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Wnd.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
diff --git a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
index 0328ee55d6152577da05478595576676d2621b96..48fb409b7bda69c3d8d802ceed030b7ce9148d39 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
@@ -90,13 +90,9 @@ CPWL_ListBox::CPWL_ListBox() :
CPWL_ListBox::~CPWL_ListBox()
{
- IFX_List::DelList(m_pList);
-
- if (m_pListNotify)
- {
- delete m_pListNotify;
- m_pListNotify = NULL;
- }
+ IFX_List::DelList(m_pList);
+ delete m_pListNotify;
+ m_pListNotify = NULL;
}
CFX_ByteString CPWL_ListBox::GetClassName() const
@@ -108,7 +104,7 @@ void CPWL_ListBox::OnCreated()
{
if (m_pList)
{
- if (m_pListNotify) delete m_pListNotify;
+ delete m_pListNotify;
m_pList->SetFontMap(GetFontMap());
m_pList->SetNotify(m_pListNotify = new CPWL_List_Notify(this));
@@ -123,11 +119,8 @@ void CPWL_ListBox::OnCreated()
void CPWL_ListBox::OnDestroy()
{
- if (m_pListNotify)
- {
- delete m_pListNotify;
- m_pListNotify = NULL;
- }
+ delete m_pListNotify;
+ m_pListNotify = NULL;
}
void CPWL_ListBox::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
« no previous file with comments | « fpdfsdk/src/javascript/app.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Wnd.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698