Index: src/JsEngine.cpp |
diff --git a/src/JsEngine.cpp b/src/JsEngine.cpp |
index 98e0e1b0eadf1929f5d536dd400f9f34a4e30633..232cb398541f5cde25eeebedb648bd1b69150f97 100644 |
--- a/src/JsEngine.cpp |
+++ b/src/JsEngine.cpp |
@@ -65,8 +65,18 @@ namespace |
}; |
} |
+AdblockPlus::ScopedV8Isolate::ScopedV8Isolate() |
+ : isolate(v8::Isolate::New()) |
Eric
2015/08/05 22:29:16
This is changing the behavior non-trivially, since
sergei
2015/11/16 16:52:09
There is no any default isolate. It `v8::Isolate::
Eric
2015/11/17 21:27:43
Sure there is. See isolate.cc:340
Isolate* Iso
|
+{ |
+} |
+ |
+AdblockPlus::ScopedV8Isolate::~ScopedV8Isolate() |
+{ |
+ isolate->Dispose(); |
Eric
2015/08/05 22:29:16
If we initialize with 'New()' rather than 'GetCurr
sergei
2015/11/16 16:52:09
Do you mean we should create a typedef on `std::sh
Eric
2015/11/17 21:27:43
No.
|
+ isolate = nullptr; |
+} |
+ |
AdblockPlus::JsEngine::JsEngine() |
- : isolate(v8::Isolate::GetCurrent()) |
{ |
} |
@@ -76,7 +86,8 @@ AdblockPlus::JsEnginePtr AdblockPlus::JsEngine::New(const AppInfo& appInfo) |
JsEnginePtr result(new JsEngine()); |
const v8::Locker locker(result->isolate); |
- const v8::HandleScope handleScope; |
+ const v8::Isolate::Scope isolateScope(result->isolate); |
+ const v8::HandleScope handleScope(result->isolate); |
result->context.reset(result->isolate, v8::Context::New(result->isolate)); |
v8::Local<v8::Object> globalContext = v8::Local<v8::Context>::New( |