Index: src/GlobalJsObject.cpp |
=================================================================== |
--- a/src/GlobalJsObject.cpp |
+++ b/src/GlobalJsObject.cpp |
@@ -66,11 +66,12 @@ |
v8::Handle<v8::Value> SetTimeoutCallback(const v8::Arguments& arguments) |
{ |
std::shared_ptr<TimeoutTask> timeoutTask; |
+ JsEnginePtr engine; |
try |
{ |
+ engine = AdblockPlus::JsEngine::FromArguments(arguments); |
AdblockPlus::JsValueList converted = |
- AdblockPlus::JsEngine::FromArguments(arguments) |
- ->ConvertArguments(arguments); |
+ engine->ConvertArguments(arguments); |
timeoutTask = std::make_shared<TimeoutTask>(converted); |
} |
catch (const std::exception& e) |
@@ -78,7 +79,7 @@ |
v8::Isolate* isolate = arguments.GetIsolate(); |
return v8::ThrowException(Utils::ToV8String(isolate, e.what())); |
} |
- Scheduler::StartImmediatelyInSingleUseThread(MakeHeapFunction(timeoutTask)); |
+ StartImmediatelyInSingleUseDetachedThread(MakeHeapFunction(timeoutTask)); |
// We should actually return the timer ID here, which could be |
// used via clearTimeout(). But since we don't seem to need |