@@ -101,6 +101,7 @@ using v8::ObjectTemplate;
101
101
using v8::Promise;
102
102
using v8::PromiseRejectMessage;
103
103
using v8::PropertyCallbackInfo;
104
+ using v8::SealHandleScope;
104
105
using v8::String;
105
106
using v8::TryCatch;
106
107
using v8::Uint32;
@@ -3836,22 +3837,25 @@ static void StartNodeInstance(void* arg) {
3836
3837
if (instance_data->use_debug_agent ())
3837
3838
EnableDebug (env);
3838
3839
3839
- bool more;
3840
- do {
3841
- v8::platform::PumpMessageLoop (default_platform, isolate);
3842
- more = uv_run (env->event_loop (), UV_RUN_ONCE);
3843
-
3844
- if (more == false ) {
3840
+ {
3841
+ SealHandleScope seal (isolate);
3842
+ bool more;
3843
+ do {
3845
3844
v8::platform::PumpMessageLoop (default_platform, isolate);
3846
- EmitBeforeExit (env);
3845
+ more = uv_run (env-> event_loop (), UV_RUN_ONCE );
3847
3846
3848
- // Emit `beforeExit` if the loop became alive either after emitting
3849
- // event, or after running some callbacks.
3850
- more = uv_loop_alive (env->event_loop ());
3851
- if (uv_run (env->event_loop (), UV_RUN_NOWAIT) != 0 )
3852
- more = true ;
3853
- }
3854
- } while (more == true );
3847
+ if (more == false ) {
3848
+ v8::platform::PumpMessageLoop (default_platform, isolate);
3849
+ EmitBeforeExit (env);
3850
+
3851
+ // Emit `beforeExit` if the loop became alive either after emitting
3852
+ // event, or after running some callbacks.
3853
+ more = uv_loop_alive (env->event_loop ());
3854
+ if (uv_run (env->event_loop (), UV_RUN_NOWAIT) != 0 )
3855
+ more = true ;
3856
+ }
3857
+ } while (more == true );
3858
+ }
3855
3859
3856
3860
int exit_code = EmitExit (env);
3857
3861
if (instance_data->is_main ())
0 commit comments