GeezerVison is showing github.com — src: cleanup in all return paths in node::Start · nodejs/node@12fb739
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/node.cc +5-2Lines changed: 5 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -760,6 +760,7 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data, |
760 | 760 | HandleScope handle_scope(isolate); |
761 | 761 | Local<Context> context = NewContext(isolate); |
762 | 762 | Context::Scope context_scope(context); |
| 763 | + int exit_code = 0; |
763 | 764 | Environment env( |
764 | 765 | isolate_data, |
765 | 766 | context, |
@@ -780,7 +781,8 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data, |
780 | 781 | true); |
781 | 782 | if (env.options()->debug_options().inspector_enabled && |
782 | 783 | !env.inspector_agent()->IsListening()) { |
783 | | - return 12; // Signal internal error. |
| 784 | + exit_code = 12; // Signal internal error. |
| 785 | + goto exit; |
784 | 786 | } |
785 | 787 | #else |
786 | 788 | // inspector_enabled can't be true if !HAVE_INSPECTOR or !NODE_USE_V8_PLATFORM |
@@ -821,10 +823,11 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data, |
821 | 823 |
|
822 | 824 | env.set_trace_sync_io(false); |
823 | 825 |
|
824 | | - const int exit_code = EmitExit(&env); |
| 826 | + exit_code = EmitExit(&env); |
825 | 827 |
|
826 | 828 | WaitForInspectorDisconnect(&env); |
827 | 829 |
|
| 830 | +exit: |
828 | 831 | env.set_can_call_into_js(false); |
829 | 832 | env.stop_sub_worker_contexts(); |
830 | 833 | uv_tty_reset_mode(); |
|