The sample code in link does not call the base method.
public override void _UnhandledInput(InputEvent @event)
{
if (@event is InputEventKey eventKey)
if (eventKey.Pressed && eventKey.Keycode == Key.Escape)
GetTree().Quit();
}
If your base class has overridden method (with some logic), note that maybe you want call base method.
I am using 4.2.2 and I have observed the same problem. Thousands of objects are created and never seemingly disposed of even if the method contains no more than the base call (or nothing whatsoever).