From 26d78d8ffffd5ef14c9063cb217fc3457842ab39 Mon Sep 17 00:00:00 2001 From: BDisp Date: Mon, 30 Oct 2023 17:15:54 +0000 Subject: [PATCH] Fixes #2944. TreeView ColorGetter not disposing sometimes causes unit test error. --- Terminal.Gui/Views/TreeView/TreeView.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Terminal.Gui/Views/TreeView/TreeView.cs b/Terminal.Gui/Views/TreeView/TreeView.cs index ba63944118..b566608762 100644 --- a/Terminal.Gui/Views/TreeView/TreeView.cs +++ b/Terminal.Gui/Views/TreeView/TreeView.cs @@ -1433,6 +1433,13 @@ internal void OnDrawLine (DrawTreeViewLineEventArgs e) DrawLine?.Invoke (this, e); } + /// + protected override void Dispose (bool disposing) + { + base.Dispose (disposing); + + ColorGetter = null; + } } class TreeSelection where T : class {