Nice one :) I am also interested in the answer. IMO it is a bug because the code is valid - https://www.freepascal.org/docs-html/ref/refse10.html FYI: Delphi doesn't create a memory leak. Ondrej