| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -515,10 +515,12 @@ bool AgentImpl::IsStarted() { | |||
| 515 | 515 | } | |
| 516 | 516 | ||
| 517 | 517 | void AgentImpl::WaitForDisconnect() { | |
| 518 | - shutting_down_ = true; | ||
| 519 | - fprintf(stderr, "Waiting for the debugger to disconnect...\n"); | ||
| 520 | - fflush(stderr); | ||
| 521 | - inspector_->runMessageLoopOnPause(0); | ||
| 518 | + if (state_ == State::kConnected) { | ||
| 519 | + shutting_down_ = true; | ||
| 520 | + fprintf(stderr, "Waiting for the debugger to disconnect...\n"); | ||
| 521 | + fflush(stderr); | ||
| 522 | + inspector_->runMessageLoopOnPause(0); | ||
| 523 | + } | ||
| 522 | 524 | } | |
| 523 | 525 | ||
| 524 | 526 | #define READONLY_PROPERTY(obj, str, var) \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,15 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + require('../common'); | ||
| 3 | + const spawn = require('child_process').spawn; | ||
| 4 | + | ||
| 5 | + const child = spawn(process.execPath, | ||
| 6 | + [ '--inspect', 'no-such-script.js' ], | ||
| 7 | + { 'stdio': 'inherit' }); | ||
| 8 | + | ||
| 9 | + function signalHandler(value) { | ||
| 10 | + child.kill(); | ||
| 11 | + process.exit(1); | ||
| 12 | + } | ||
| 13 | + | ||
| 14 | + process.on('SIGINT', signalHandler); | ||
| 15 | + process.on('SIGTERM', signalHandler); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments