04-07-2023, 08:52 PM
(This post was last modified: 04-07-2023, 08:53 PM by Alexandre Machado.)
If I create a TStringList inside the method and return a instance to the calling code you will also have to deal with its destruction and call it inside a try..finally block which is basically an anti-pattern considering this specific scenario.
It is a much better and clean code if the calling code creates the TStringList and takes care of its destruction.
It is a much better and clean code if the calling code creates the TStringList and takes care of its destruction.

