Index: src/JsContext.cpp |
diff --git a/src/JsContext.cpp b/src/JsContext.cpp |
index dd8faf6ff4b8c765a18831ebd5dee6d377db7bef..bd2916a4a176f19d25fcc81147c7c7c54c93a1dc 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>& jsEngineArg) |
+ : jsEngine(Utils::lockJsEngine(jsEngineArg)) |
+ , locker(jsEngine->GetIsolate()) |
+ , isolateScope(jsEngine->GetIsolate()) |
+ , handleScope(jsEngine->GetIsolate()) |
+ , contextScope(v8::Local<v8::Context>::New(jsEngine->GetIsolate(), *jsEngine->context)) |
{ |
} |