Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/JsEngine.cpp

Issue 29691607: Issue 6365 - dispose v8::Isolate with a long enough delay (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: fix coding style Created Feb. 7, 2018, 2:54 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/JsEngine.cpp
diff --git a/src/JsEngine.cpp b/src/JsEngine.cpp
index 0816304a75f1e3ff8e0b3f3f09fa7ef98ceaa74d..ce9918469ab86d202d9231c9016e8a43baf90e54 100644
--- a/src/JsEngine.cpp
+++ b/src/JsEngine.cpp
@@ -85,7 +85,13 @@ AdblockPlus::ScopedV8Isolate::ScopedV8Isolate()
AdblockPlus::ScopedV8Isolate::~ScopedV8Isolate()
{
- isolate->Dispose();
+ auto capturedIsolatePtr = isolate;
+ std::thread([capturedIsolatePtr]
+ {
+ std::chrono::seconds timeout(60 * 10);
+ std::this_thread::sleep_for(timeout);
+ capturedIsolatePtr->Dispose();
+ }).detach();
isolate = nullptr;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld