diff --git a/src/inspector_io.cc b/src/inspector_io.cc index a7d69263edad6d..12a0d20720354a 100644 --- a/src/inspector_io.cc +++ b/src/inspector_io.cc @@ -429,8 +429,6 @@ void InspectorIo::MainThreadReqAsyncCb(uv_async_t* req) { void InspectorIo::Write(TransportAction action, int session_id, const StringView& inspector_message) { - if (state_ == State::kShutDown) - return; AppendMessage(&outgoing_message_queue_, action, session_id, StringBuffer::create(inspector_message)); int err = uv_async_send(&thread_req_); diff --git a/test/inspector/test-inspector-stop-profile-after-done.js b/test/inspector/test-inspector-stop-profile-after-done.js new file mode 100644 index 00000000000000..db43e4ae79c4bd --- /dev/null +++ b/test/inspector/test-inspector-stop-profile-after-done.js @@ -0,0 +1,21 @@ +'use strict'; +const common = require('../common'); +common.skipIfInspectorDisabled(); +const helper = require('./inspector-helper.js'); + +function test(session) { + session.sendInspectorCommands([ + { 'method': 'Runtime.runIfWaitingForDebugger' }, + { 'method': 'Profiler.setSamplingInterval', 'params': { 'interval': 100 } }, + { 'method': 'Profiler.enable' }, + { 'method': 'Profiler.start' }]); + session.expectStderrOutput('Waiting for the debugger to disconnect...'); + session.sendInspectorCommands({ 'method': 'Profiler.stop' }); + session.disconnect(true); +} + +function runTests(harness) { + harness.runFrontendSession([test]).expectShutDown(0); +} + +helper.startNodeForInspectorTest(runTests, ['--inspect-brk'], 'let a = 2;');