2017-10-07 2:10 GMT+02:00 Michalis Kamburelis <michalis.ka...@gmail.com>:
> Your TSmartObj is, well, exactly what I want:) As long as you pass > around only "TSmartObj<TSomeObject1>" (and don't create cycles :) ), > you're perfectly safe and leak-free. > Probably management operators idea will be expanded by new operators Clone & Assign (names are still debatable), still some research is needed for new operators for multi-threaded aspect: (see Eric Grange comments) https://plus.google.com/u/0/115782878581272923715/posts/ETUoFXtoAYX 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# -- Best regards, Maciej Izak
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal