diff options
author | Lei Zhang <thestig@chromium.org> | 2015-06-19 14:51:10 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-06-19 14:51:10 -0700 |
commit | cfac954abcab7caf47d3fa3d641c553cba998271 (patch) | |
tree | 4cd546a2377e973fec54b75c1002c8c0ff321e8f /fpdfsdk/src/fsdk_mgr.cpp | |
parent | df558514bf5cb5750d5a7000a843f45f4170d5a4 (diff) | |
download | pdfium-cfac954abcab7caf47d3fa3d641c553cba998271.tar.xz |
Cleanup: Do not check pointers before deleting them.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1192743004.
Diffstat (limited to 'fpdfsdk/src/fsdk_mgr.cpp')
-rw-r--r-- | fpdfsdk/src/fsdk_mgr.cpp | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp index b8028aad73..5d4680d978 100644 --- a/fpdfsdk/src/fsdk_mgr.cpp +++ b/fpdfsdk/src/fsdk_mgr.cpp @@ -239,34 +239,19 @@ CPDFDoc_Environment::CPDFDoc_Environment(CPDF_Document* pDoc) : CPDFDoc_Environment::~CPDFDoc_Environment() { + delete m_pIFormFiller; + m_pIFormFiller = NULL; + if (m_pJSRuntime && m_pJSRuntimeFactory) + m_pJSRuntimeFactory->DeleteJSRuntime(m_pJSRuntime); + m_pJSRuntimeFactory->Release(); - if ( m_pIFormFiller ) - { - delete m_pIFormFiller; - m_pIFormFiller = NULL; - } - if(m_pJSRuntime && m_pJSRuntimeFactory) - m_pJSRuntimeFactory->DeleteJSRuntime(m_pJSRuntime); - m_pJSRuntimeFactory->Release(); - - if(m_pSysHandler) - { - delete m_pSysHandler; - m_pSysHandler = NULL; - } - - if(m_pAnnotHandlerMgr) - { - delete m_pAnnotHandlerMgr; - m_pAnnotHandlerMgr = NULL; - } - if(m_pActionHandler) - { - delete m_pActionHandler; - m_pActionHandler = NULL; - } - + delete m_pSysHandler; + m_pSysHandler = NULL; + delete m_pAnnotHandlerMgr; + m_pAnnotHandlerMgr = NULL; + delete m_pActionHandler; + m_pActionHandler = NULL; } @@ -639,11 +624,10 @@ CPDFSDK_PageView::~CPDFSDK_PageView() pAnnotHandlerMgr->ReleaseAnnot(pAnnot); } m_fxAnnotArray.RemoveAll(); - if(m_pAnnotList) - { - delete m_pAnnotList; - m_pAnnotList = NULL; - } + + delete m_pAnnotList; + m_pAnnotList = NULL; + m_page->RemovePrivateData((void*)m_page); if(m_bTakeOverPage) { delete m_page; |