File tree Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -911,10 +911,11 @@ void Environment::InitializeLibuv() {
911
911
StartProfilerIdleNotifier ();
912
912
}
913
913
914
- void Environment::ExitEnv () {
914
+ void Environment::ExitEnv (bool terminate ) {
915
915
// Should not access non-thread-safe methods here.
916
916
set_stopping (true );
917
- isolate_->TerminateExecution ();
917
+ if (terminate)
918
+ isolate_->TerminateExecution ();
918
919
SetImmediateThreadsafe ([](Environment* env) {
919
920
env->set_can_call_into_js (false );
920
921
uv_stop (env->event_loop ());
Original file line number Diff line number Diff line change @@ -636,7 +636,7 @@ class Environment : public MemoryRetainer {
636
636
void RegisterHandleCleanups ();
637
637
void CleanupHandles ();
638
638
void Exit (ExitCode code);
639
- void ExitEnv ();
639
+ void ExitEnv (bool terminate );
640
640
641
641
// Register clean-up cb to be called on environment destruction.
642
642
inline void RegisterHandleCleanup (uv_handle_t * handle,
Original file line number Diff line number Diff line change @@ -1253,8 +1253,8 @@ int Start(int argc, char** argv) {
1253
1253
return static_cast <int >(StartInternal (argc, argv));
1254
1254
}
1255
1255
1256
- int Stop (Environment* env) {
1257
- env->ExitEnv ();
1256
+ int Stop (Environment* env, bool terminate ) {
1257
+ env->ExitEnv (terminate );
1258
1258
return 0 ;
1259
1259
}
1260
1260
Original file line number Diff line number Diff line change @@ -308,7 +308,7 @@ NODE_EXTERN int Start(int argc, char* argv[]);
308
308
309
309
// Tear down Node.js while it is running (there are active handles
310
310
// in the loop and / or actively executing JavaScript code).
311
- NODE_EXTERN int Stop (Environment* env);
311
+ NODE_EXTERN int Stop (Environment* env, bool terminate = true );
312
312
313
313
// Set up per-process state needed to run Node.js. This will consume arguments
314
314
// from argv, fill exec_argv, and possibly add errors resulting from parsing
You can’t perform that action at this time.
0 commit comments