fix: ensure the inspector agent is shutdown before cleaning up the node env (#18028)
* fix: ensure the inspector agent is shutdown before cleaning up the node env * spec: add tests to ensure clean shutdown with connected inspector agent * Update node_debugger.cc
This commit is contained in:
parent
4e5a0946c7
commit
67b3fbca89
6 changed files with 55 additions and 2 deletions
|
@ -452,6 +452,7 @@ void AtomBrowserMainParts::PostMainMessageLoopRun() {
|
|||
ui::SetX11ErrorHandlers(X11EmptyErrorHandler, X11EmptyIOErrorHandler);
|
||||
#endif
|
||||
|
||||
node_debugger_->Stop();
|
||||
js_env_->OnMessageLoopDestroying();
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
|
|
|
@ -58,4 +58,10 @@ void NodeDebugger::Start() {
|
|||
DCHECK(env_->inspector_agent()->IsListening());
|
||||
}
|
||||
|
||||
void NodeDebugger::Stop() {
|
||||
auto* inspector = env_->inspector_agent();
|
||||
if (inspector && inspector->IsListening())
|
||||
inspector->Stop();
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
|
@ -20,6 +20,7 @@ class NodeDebugger {
|
|||
~NodeDebugger();
|
||||
|
||||
void Start();
|
||||
void Stop();
|
||||
|
||||
private:
|
||||
node::Environment* env_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue