diff options
author | weili <weili@chromium.org> | 2016-08-03 11:06:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-03 11:06:49 -0700 |
commit | 2d5b020304e8a9aa8afeb632c61daa7ece87e36d (patch) | |
tree | 4d7f04d4800577fa597b4ca1f1b4d31b87194ef0 /fpdfsdk/javascript/cjs_context.cpp | |
parent | ca27127240fbca2184f1c576b15b5212d5b314e6 (diff) | |
download | pdfium-2d5b020304e8a9aa8afeb632c61daa7ece87e36d.tar.xz |
Use smart pointers for class owned pointers
For all classes under /fpdfsdk, use smart pointer to replace
raw pointer type for class owned member variables so that memory
management will be easier.
BUG=pdfium:518
Review-Url: https://codereview.chromium.org/2173253002
Diffstat (limited to 'fpdfsdk/javascript/cjs_context.cpp')
-rw-r--r-- | fpdfsdk/javascript/cjs_context.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fpdfsdk/javascript/cjs_context.cpp b/fpdfsdk/javascript/cjs_context.cpp index 406339d7af..06abf7f48d 100644 --- a/fpdfsdk/javascript/cjs_context.cpp +++ b/fpdfsdk/javascript/cjs_context.cpp @@ -11,13 +11,11 @@ #include "fpdfsdk/javascript/resource.h" CJS_Context::CJS_Context(CJS_Runtime* pRuntime) - : m_pRuntime(pRuntime), m_bBusy(FALSE) { - m_pEventHandler = new CJS_EventHandler(this); -} + : m_pRuntime(pRuntime), + m_pEventHandler(new CJS_EventHandler(this)), + m_bBusy(FALSE) {} -CJS_Context::~CJS_Context() { - delete m_pEventHandler; -} +CJS_Context::~CJS_Context() {} CPDFSDK_Document* CJS_Context::GetReaderDocument() { return m_pRuntime->GetReaderDocument(); |