OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 78 } |
79 | 79 |
80 AdblockPlus::ScopedV8Isolate::ScopedV8Isolate() | 80 AdblockPlus::ScopedV8Isolate::ScopedV8Isolate() |
81 { | 81 { |
82 V8Initializer::Init(); | 82 V8Initializer::Init(); |
83 isolate = v8::Isolate::New(); | 83 isolate = v8::Isolate::New(); |
84 } | 84 } |
85 | 85 |
86 AdblockPlus::ScopedV8Isolate::~ScopedV8Isolate() | 86 AdblockPlus::ScopedV8Isolate::~ScopedV8Isolate() |
87 { | 87 { |
88 isolate->Dispose(); | 88 auto capturedIsolatePtr = isolate; |
| 89 std::thread([capturedIsolatePtr] |
| 90 { |
| 91 std::chrono::seconds timeout(60 * 10); |
| 92 std::this_thread::sleep_for(timeout); |
| 93 capturedIsolatePtr->Dispose(); |
| 94 }).detach(); |
89 isolate = nullptr; | 95 isolate = nullptr; |
90 } | 96 } |
91 | 97 |
92 JsEngine::JsWeakValuesList::~JsWeakValuesList() | 98 JsEngine::JsWeakValuesList::~JsWeakValuesList() |
93 { | 99 { |
94 for (auto& value : values) | 100 for (auto& value : values) |
95 value->Dispose(); | 101 value->Dispose(); |
96 } | 102 } |
97 | 103 |
98 void JsEngine::NotifyLowMemory() | 104 void JsEngine::NotifyLowMemory() |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 logSystem = val; | 345 logSystem = val; |
340 } | 346 } |
341 | 347 |
342 | 348 |
343 void AdblockPlus::JsEngine::SetGlobalProperty(const std::string& name, | 349 void AdblockPlus::JsEngine::SetGlobalProperty(const std::string& name, |
344 const AdblockPlus::JsValue& value) | 350 const AdblockPlus::JsValue& value) |
345 { | 351 { |
346 auto global = GetGlobalObject(); | 352 auto global = GetGlobalObject(); |
347 global.SetProperty(name, value); | 353 global.SetProperty(name, value); |
348 } | 354 } |
OLD | NEW |