summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-07-16 18:28:49 -0700
committerLei Zhang <thestig@chromium.org>2015-07-16 18:28:49 -0700
commit21bf242a31eff79f754c5e9c3b41c52e33483bb0 (patch)
tree0eff85fa75ab9091254f7560b37b95408ba8975e /fpdfsdk/src/javascript
parent6915e7bd9e0892f143936697c6ba233510fb13dc (diff)
downloadpdfium-21bf242a31eff79f754c5e9c3b41c52e33483bb0.tar.xz
Cleanup: Do not check pointers before deleting them, part 2.
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1195363002 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r--fpdfsdk/src/javascript/JS_Context.cpp6
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp3
2 files changed, 2 insertions, 7 deletions
diff --git a/fpdfsdk/src/javascript/JS_Context.cpp b/fpdfsdk/src/javascript/JS_Context.cpp
index 924ab1ee19..72be34d751 100644
--- a/fpdfsdk/src/javascript/JS_Context.cpp
+++ b/fpdfsdk/src/javascript/JS_Context.cpp
@@ -24,11 +24,7 @@ CJS_Context::CJS_Context(CJS_Runtime* pRuntime) :
CJS_Context::~CJS_Context(void)
{
- if (m_pEventHandler)
- {
- delete m_pEventHandler;
- m_pEventHandler = NULL;
- }
+ delete m_pEventHandler;
}
CPDFSDK_Document* CJS_Context::GetReaderDocument()
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index f21819ac17..2343eb3a43 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -65,8 +65,7 @@ void CJS_RuntimeFactory::Release()
void CJS_RuntimeFactory::DeleteJSRuntime(IFXJS_Runtime* pRuntime)
{
- if(pRuntime)
- delete (CJS_Runtime*)pRuntime;
+ delete (CJS_Runtime*)pRuntime;
}
CJS_GlobalData* CJS_RuntimeFactory::NewGlobalData(CPDFDoc_Environment* pApp)