| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9c277c0 commit 170e196
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -268,6 +268,14 @@ void MainThreadInterface::DispatchMessages() { | |||
| 268 | 268 | MessageQueue::value_type task; | |
| 269 | 269 | std::swap(dispatching_message_queue_.front(), task); | |
| 270 | 270 | dispatching_message_queue_.pop_front(); | |
| 271 | + | ||
| 272 | + // TODO(addaleax): The V8 inspector code currently sometimes allocates | ||
| 273 | + // handles that leak to the outside scope, rendering a HandleScope here | ||
| 274 | + // necessary. This handle scope can be removed/turned into a | ||
| 275 | + // SealHandleScope once/if | ||
| 276 | + // https://chromium-review.googlesource.com/c/v8/v8/+/1484304 makes it | ||
| 277 | + // into our copy of V8, maybe guarded with #ifdef DEBUG if we want. | ||
| 278 | + v8::HandleScope handle_scope(isolate_); | ||
| 271 | 279 | task->Call(this); | |
| 272 | 280 | } | |
| 273 | 281 | } while (had_messages); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,11 +8,11 @@ | |||
| 8 | 8 | ||
| 9 | 9 | namespace node { | |
| 10 | 10 | ||
| 11 | - using v8::HandleScope; | ||
| 12 | 11 | using v8::Isolate; | |
| 13 | 12 | using v8::Local; | |
| 14 | 13 | using v8::Object; | |
| 15 | 14 | using v8::Platform; | |
| 15 | + using v8::SealHandleScope; | ||
| 16 | 16 | using v8::Task; | |
| 17 | 17 | using node::tracing::TracingController; | |
| 18 | 18 | ||
@@ -332,7 +332,9 @@ int NodePlatform::NumberOfWorkerThreads() { | |||
| 332 | 332 | ||
| 333 | 333 | void PerIsolatePlatformData::RunForegroundTask(std::unique_ptr<Task> task) { | |
| 334 | 334 | Isolate* isolate = Isolate::GetCurrent(); | |
| 335 | - HandleScope scope(isolate); | ||
| 335 | + #ifdef DEBUG | ||
| 336 | + SealHandleScope scope(isolate); | ||
| 337 | + #endif | ||
| 336 | 338 | Environment* env = Environment::GetCurrent(isolate); | |
| 337 | 339 | if (env != nullptr) { | |
| 338 | 340 | InternalCallbackScope cb_scope(env, Local<Object>(), { 0, 0 }, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments