Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
debug: clean up handles when reentering the debugger, avoid memory leak
Browse files Browse the repository at this point in the history
Co-authored-by: Joel Hendrix <jhendrix@microsoft.com>
  • Loading branch information
xiphon and jhendrixMSFT committed Jan 29, 2019
1 parent 769d46f commit 0be2604
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/debugAdapter/goDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,14 @@ class GoDebugSession extends LoggingDebugSession {
return typeName.substr(i + 1);
}

private cleanupHandles(): void {
this._variableHandles.reset();
this.stackFrameHandles.reset();
}

private handleReenterDebug(reason: string): void {
this.cleanupHandles();

if (this.debugState.exited) {
this.sendEvent(new TerminatedEvent());
log('TerminatedEvent');
Expand Down

0 comments on commit 0be2604

Please sign in to comment.