提交 bf9fe229 编写于 作者: I isidor

debug: cancel all promises on session end with a 1s timeout

fixes #4861
上级 c34d5633
......@@ -144,9 +144,13 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
if (this.stopServerPending && force) {
return this.stopServer();
}
// Cancel all sent promises on disconnect so debug trees are not left in a broken state #3666.
this.sentPromises.forEach(p => p.cancel());
this.sentPromises = [];
// Give a 1s timeout to give a chance for some promises to complete.
setTimeout(() => {
this.sentPromises.forEach(p => p.cancel());
this.sentPromises = [];
}, 1000);
if ((this.serverProcess || this.socket) && !this.stopServerPending) {
// point of no return: from now on don't report any errors
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册