On Mon, Oct 9, 2017 at 5:24 AM, Maciej Izak <hnb.c...@gmail.com> wrote: > 2017-10-07 2:10 GMT+02:00 Michalis Kamburelis <michalis.ka...@gmail.com>: >> >> [...] > > mORMot framework has also nice solution for "auto free" (solution uses > interfaces too): > > ===code begin=== > with TAutoFree.One(o, TObject.Create) do > begin > ... > Another(o2, TObject.Create); > ... > end; > > with TAutoFree.Several([ > o, TObject.Create, > f, TFoo.Create, > sl, TStringList.Create]) > do > begin > ... > end; > ===code end=== > > somehow similar in usage like "using" from C#
This TAutoFree just "put" the "finally" and call .Free for an array of objects or does it something else? Could you send the link of the implementation? Best regards, Marcos Douglas _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal