Index: src/JsContext.cpp |
diff --git a/src/JsContext.cpp b/src/JsContext.cpp |
index dd8faf6ff4b8c765a18831ebd5dee6d377db7bef..e56ca7fb258b2d38675fe171d1a74cb6ebf973e7 100644 |
--- a/src/JsContext.cpp |
+++ b/src/JsContext.cpp |
@@ -16,10 +16,13 @@ |
*/ |
#include "JsContext.h" |
+#include "Utils.h" |
-AdblockPlus::JsContext::JsContext(const JsEnginePtr jsEngine) |
- : locker(jsEngine->GetIsolate()), isolateScope(jsEngine->GetIsolate()), |
- handleScope(jsEngine->GetIsolate()), |
- contextScope(v8::Local<v8::Context>::New(jsEngine->GetIsolate(), *jsEngine->context)) |
+AdblockPlus::JsContext::JsContext(const std::weak_ptr<JsEngine>& jsEngine) |
+ : m_jsEngine(Utils::lockJsEngine(jsEngine)) |
+ , m_locker(m_jsEngine->GetIsolate()) |
+ , m_isolateScope(m_jsEngine->GetIsolate()) |
+ , m_handleScope(m_jsEngine->GetIsolate()) |
+ , m_contextScope(v8::Local<v8::Context>::New(m_jsEngine->GetIsolate(), *m_jsEngine->context)) |
{ |
} |