Index: src/WebRequestJsObject.cpp |
=================================================================== |
--- a/src/WebRequestJsObject.cpp |
+++ b/src/WebRequestJsObject.cpp |
@@ -90,9 +90,10 @@ |
v8::Handle<v8::Value> GETCallback(const v8::Arguments& arguments) |
{ |
std::shared_ptr<WebRequestTask> thread; |
+ AdblockPlus::JsEnginePtr jsEngine; |
try |
{ |
- AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::FromArguments(arguments); |
+ jsEngine = AdblockPlus::JsEngine::FromArguments(arguments); |
AdblockPlus::JsValueList converted = jsEngine->ConvertArguments(arguments); |
if (converted.size() != 3u) |
throw std::runtime_error("GET requires exactly 3 arguments"); |
@@ -104,7 +105,7 @@ |
v8::Isolate* isolate = arguments.GetIsolate(); |
return v8::ThrowException(ToV8String(isolate, e.what())); |
} |
- StartImmediatelyInSingleUseDetachedThread(AdblockPlus::MakeHeapFunction(thread)); |
+ jsEngine->Schedule(AdblockPlus::MakeHeapFunction(thread), AdblockPlus::ImmediateSingleUseThread); |
return v8::Undefined(); |
} |
} |