mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 00:09:30 +01:00
Fix "target closed" error in BrowserViewDebugger by checking isDestroyed before detach
Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/8233ab57-121b-4677-9a2b-aee47e824ba6 Co-authored-by: bryanchen-d <41454397+bryanchen-d@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
97e0df7ef4
commit
747b79d915
@@ -168,6 +168,13 @@ export class BrowserViewDebugger extends Disposable implements ICDPTarget {
|
||||
}
|
||||
|
||||
this._electronDebugger.removeListener('message', this._messageHandler);
|
||||
|
||||
// If the WebContents is already destroyed, there is nothing to detach from.
|
||||
// This happens when disposal is triggered by the 'destroyed' event on the WebContents.
|
||||
if (this.view.webContents.isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
this._electronDebugger.detach();
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user