Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ff877e9

Browse filesBrowse files
viiryabnoordhuis
authored andcommitted
src: fix stuck debugger process
The debug process running "node debug a.js" will be stuck when the script ends. This is because the debug handler has been unrefed. We shouldn't unref the debug handler to avoid this problem. PR-URL: #2778 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 6f14b3a commit ff877e9
Copy full SHA for ff877e9

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3652,7 +3652,6 @@ void Init(int* argc,
36523652
uv_async_init(uv_default_loop(),
36533653
&dispatch_debug_messages_async,
36543654
DispatchDebugMessagesAsyncCallback);
3655-
uv_unref(reinterpret_cast<uv_handle_t*>(&dispatch_debug_messages_async));
36563655

36573656
#if defined(NODE_V8_OPTIONS)
36583657
// Should come before the call to V8::SetFlagsFromCommandLine()
@@ -3959,8 +3958,11 @@ static void StartNodeInstance(void* arg) {
39593958
env->set_trace_sync_io(trace_sync_io);
39603959

39613960
// Enable debugger
3962-
if (instance_data->use_debug_agent())
3961+
if (instance_data->use_debug_agent()) {
39633962
EnableDebug(env);
3963+
} else {
3964+
uv_unref(reinterpret_cast<uv_handle_t*>(&dispatch_debug_messages_async));
3965+
}
39643966

39653967
{
39663968
SealHandleScope seal(isolate);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.