@@ -14,7 +14,7 @@ export class LiveWatchTreeDataProvider implements vscode.TreeDataProvider<LiveWa
1414
1515 private readonly _onDidChangeTreeData = new vscode . EventEmitter < LiveWatchNode | void > ( ) ;
1616 readonly onDidChangeTreeData : vscode . Event < LiveWatchNode | void > = this . _onDidChangeTreeData . event ;
17-
17+
1818 private roots : LiveWatchNode [ ] = [ ] ;
1919 private _context : vscode . ExtensionContext ;
2020 private continueEvaluate : boolean = true ;
@@ -51,20 +51,26 @@ export class LiveWatchTreeDataProvider implements vscode.TreeDataProvider<LiveWa
5151 this . continueEvaluate = false ;
5252 } ) ;
5353 const onWillStartSession = tracker . onWillStartSession ( session => this . handleOnWillStartSession ( session ) ) ;
54- // Doing a refresh on stop to ensure we have the latest data
54+ // Doing a refresh on pausing to ensure we have the latest data
5555 const onStopped = tracker . onStopped ( ( ) => this . refresh ( ) ) ;
5656 // Using this event because this is when the threadId is available for evaluations
5757 const onStackTrace = tracker . onDidChangeActiveStackItem ( ( ) => this . refresh ( ) ) ;
58+ // Clearing active session on closing the session
59+ const onWillStopSession = tracker . onWillStopSession ( session => {
60+ this . activeSession = session ;
61+ this . refresh ( ) ;
62+ } ) ;
5863 this . _context . subscriptions . push ( onDidChangeActiveDebugSession ) ;
5964 this . _context . subscriptions . push ( onWillStartSession ) ;
6065 this . _context . subscriptions . push ( onStopped ) ;
6166 this . _context . subscriptions . push ( onStackTrace ) ;
67+ this . _context . subscriptions . push ( onWillStopSession ) ;
6268 }
6369
6470 handleOnWillStartSession ( session : GDBTargetDebugSession ) : void {
6571 session . refreshTimer . onRefresh ( async ( refreshSession ) => {
6672 this . activeSession = refreshSession ;
67- this . refresh ( )
73+ this . refresh ( ) ;
6874 } ) ;
6975 }
7076 addVSCodeCommands ( ) {
0 commit comments