summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/cjs_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/javascript/cjs_context.h')
-rw-r--r--fpdfsdk/javascript/cjs_context.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/fpdfsdk/javascript/cjs_context.h b/fpdfsdk/javascript/cjs_context.h
index cccdbc7669..49ba42c6d1 100644
--- a/fpdfsdk/javascript/cjs_context.h
+++ b/fpdfsdk/javascript/cjs_context.h
@@ -7,6 +7,8 @@
#ifndef FPDFSDK_JAVASCRIPT_CJS_CONTEXT_H_
#define FPDFSDK_JAVASCRIPT_CJS_CONTEXT_H_
+#include <memory>
+
#include "core/fxcrt/include/fx_string.h"
#include "core/fxcrt/include/fx_system.h"
#include "fpdfsdk/javascript/ijs_context.h"
@@ -121,14 +123,14 @@ class CJS_Context : public IJS_Context {
void OnExternal_Exec() override;
CJS_Runtime* GetJSRuntime() const { return m_pRuntime; }
- CJS_EventHandler* GetEventHandler() const { return m_pEventHandler; }
+ CJS_EventHandler* GetEventHandler() const { return m_pEventHandler.get(); }
CPDFDoc_Environment* GetReaderApp();
CPDFSDK_Document* GetReaderDocument();
private:
- CJS_Runtime* m_pRuntime;
- CJS_EventHandler* m_pEventHandler;
+ CJS_Runtime* const m_pRuntime;
+ std::unique_ptr<CJS_EventHandler> m_pEventHandler;
FX_BOOL m_bBusy;
};