clear threads and variables on stop

This commit is contained in:
Matt Parker
2025-12-12 19:30:32 +10:00
parent 253b3f0aac
commit 1ab3d62bec

View File

@@ -28,8 +28,25 @@ public partial class ThreadsVariablesSubTab : Control
GlobalEvents.Instance.DebuggerExecutionStopped.Subscribe(OnDebuggerExecutionStopped);
_threadsTree.ItemSelected += OnThreadSelected;
_stackFramesTree.ItemSelected += OnStackFrameSelected;
Project.ProjectStoppedRunning.Subscribe(ProjectStoppedRunning);
}
public override void _ExitTree()
{
GlobalEvents.Instance.DebuggerExecutionStopped.Unsubscribe(OnDebuggerExecutionStopped);
Project.ProjectStoppedRunning.Unsubscribe(ProjectStoppedRunning);
}
private async Task ProjectStoppedRunning()
{
await this.InvokeAsync(() =>
{
_threadsTree.Clear();
_stackFramesTree.Clear();
_variablesTree.Clear();
});
}
private async void OnThreadSelected()
{
var selectedItem = _threadsTree.GetSelected();