summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-08-03 11:06:49 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-03 11:06:49 -0700
commit2d5b020304e8a9aa8afeb632c61daa7ece87e36d (patch)
tree4d7f04d4800577fa597b4ca1f1b4d31b87194ef0 /fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
parentca27127240fbca2184f1c576b15b5212d5b314e6 (diff)
downloadpdfium-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/fpdfxfa/fpdfxfa_app.cpp')
-rw-r--r--fpdfsdk/fpdfxfa/fpdfxfa_app.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
index 22d84f1f9f..b829246908 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
@@ -33,16 +33,12 @@ void CPDFXFA_App::ReleaseInstance() {
CPDFXFA_App::CPDFXFA_App()
: m_bJavaScriptInitialized(FALSE),
- m_pXFAApp(nullptr),
m_pIsolate(nullptr),
m_csAppType(JS_STR_VIEWERTYPE_STANDARD) {
m_pEnvList.RemoveAll();
}
CPDFXFA_App::~CPDFXFA_App() {
- delete m_pXFAApp;
- m_pXFAApp = nullptr;
-
FXJSE_Runtime_Release(m_pIsolate);
m_pIsolate = nullptr;
@@ -58,7 +54,7 @@ FX_BOOL CPDFXFA_App::Initialize(v8::Isolate* pIsolate) {
if (!m_pIsolate)
return FALSE;
- m_pXFAApp = new CXFA_FFApp(this);
+ m_pXFAApp.reset(new CXFA_FFApp(this));
m_pXFAApp->SetDefaultFontMgr(
std::unique_ptr<CXFA_DefFontMgr>(new CXFA_DefFontMgr));