I get an memory leak from FastMM after shutdown on version 1543.
I don’t understand why, but it is the comparer used to sort the result array that causes it. By declaring the it as a local variable with explicit interface type (IComparer), it works. This must be a Delphi issue as the comparer parameter of TArray.Sort is declared as an interface, and the compiler should have inferred the type as an interface and not a class instance.
This is on Delphi 11.1.
This is how I have solved it for now:
var vComparer:IComparer := TDelegatedComparer.Create(
function(const Left, Right: TRTTIType): Integer
begin
Result := AnsiCompareText(Left.Name, Right.Name)
end);
TArray.Sort(Result,vComparer);