<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-10-07 2:10 GMT+02:00 Michalis Kamburelis <span dir="ltr"><<a href="mailto:michalis.kambi@gmail.com" target="_blank">michalis.kambi@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Your TSmartObj is, well, exactly what I want:) As long as you pass<br>
around only "TSmartObj<TSomeObject1>" (and don't create cycles :) ),<br>
you're perfectly safe and leak-free.<br></blockquote><div><br></div><div>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: </div></div><div class="gmail_extra"><br></div>(see Eric Grange comments)<br clear="all"><div><a href="https://plus.google.com/u/0/115782878581272923715/posts/ETUoFXtoAYX">https://plus.google.com/u/0/115782878581272923715/posts/ETUoFXtoAYX</a><br></div><div><br></div><div>mORMot framework has also nice solution for "auto free" (solution uses interfaces too):</div><div><br></div><div>===code begin===</div><div><div> with TAutoFree.One(o, TObject.Create) do</div><div> begin</div><div> ...</div><div> Another(o2, TObject.Create);</div><div> ...</div><div> end;</div><div><br></div><div> with TAutoFree.Several([</div><div> o, TObject.Create,</div><div> f, TFoo.Create,</div><div> sl, TStringList.Create])</div><div> do</div><div> begin</div><div> ...</div><div> end; </div></div><div>===code end===</div><div><br></div><div>somehow similar in usage like "using" from C#</div><div><br></div>-- <br><div class="gmail-m_-1479570709330305231gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>