diff --git a/Terminal.Gui/Core.cs b/Terminal.Gui/Core.cs index 6f2eeb6d5..06d125332 100644 --- a/Terminal.Gui/Core.cs +++ b/Terminal.Gui/Core.cs @@ -245,6 +245,8 @@ namespace Terminal.Gui { public static ConsoleDriver Driver = Application.Driver; static IList empty = new List (0).AsReadOnly (); + + // This is null, and allocated on demand. List subviews; /// @@ -252,6 +254,9 @@ namespace Terminal.Gui { /// /// The subviews. public IList Subviews => subviews == null ? empty : subviews.AsReadOnly (); + + // Internally, we use InternalSubviews rather than subviews, as we do not expect us + // to make the same mistakes our users make when they poke at the Subviews. internal IList InternalSubviews => subviews ?? empty; internal Rect NeedDisplay { get; private set; } = Rect.Empty;