Skip to content

Commit f21212a

Browse files
committed
src: use global SealHandleScope
Helps to find Handle leaks in Debug mode. Ref: a5244d3 "deps: backport 1f8555 from v8's upstream" PR-URL: #3945 Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: James Snell <jasnell@gmail.com>
1 parent a042e41 commit f21212a

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

src/node.cc

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ using v8::Number;
115115
using v8::Object;
116116
using v8::ObjectTemplate;
117117
using v8::PropertyCallbackInfo;
118+
using v8::SealHandleScope;
118119
using v8::String;
119120
using v8::TryCatch;
120121
using v8::Uint32;
@@ -3755,19 +3756,23 @@ int Start(int argc, char** argv) {
37553756
if (use_debug_agent)
37563757
EnableDebug(env);
37573758

3758-
bool more;
3759-
do {
3760-
more = uv_run(env->event_loop(), UV_RUN_ONCE);
3761-
if (more == false) {
3762-
EmitBeforeExit(env);
3763-
3764-
// Emit `beforeExit` if the loop became alive either after emitting
3765-
// event, or after running some callbacks.
3766-
more = uv_loop_alive(env->event_loop());
3767-
if (uv_run(env->event_loop(), UV_RUN_NOWAIT) != 0)
3768-
more = true;
3769-
}
3770-
} while (more == true);
3759+
{
3760+
SealHandleScope seal(node_isolate);
3761+
bool more;
3762+
do {
3763+
more = uv_run(env->event_loop(), UV_RUN_ONCE);
3764+
if (more == false) {
3765+
EmitBeforeExit(env);
3766+
3767+
// Emit `beforeExit` if the loop became alive either after emitting
3768+
// event, or after running some callbacks.
3769+
more = uv_loop_alive(env->event_loop());
3770+
if (uv_run(env->event_loop(), UV_RUN_NOWAIT) != 0)
3771+
more = true;
3772+
}
3773+
} while (more == true);
3774+
}
3775+
37713776
code = EmitExit(env);
37723777
RunAtExit(env);
37733778

0 commit comments

Comments
 (0)