[fpc-pascal] Yet again Objects auto destruction
augustoktobar at gmail.com
Fri Apr 19 00:18:17 CEST 2013
On Thu, Apr 18, 2013 at 3:55 PM, Zaher Dirkey <parmaja at gmail.com> wrote:
> I think it is not the first time this topic was opened, but still think we
> need when using object to have automatically destructor called by compiler
> when the object freed
> TmyObject = object
> FSQL: TStringList;
> constructor Init(SQL: string);
> destructor Free;
> constructor TmyObject.Init(SQL: string);
> destructor TmyObject.Free;
> Here in the example we can call init manually and it is not a problem,
> because it is always we know who is create this object.
> But free or destroy can not call it manually, we not know who will kill
> that object first, because many of another object assigned to it.
> I know about Interfaces but i hate use it,
> All just we need new feature to call "destroy" when freeing the object.
> Best Regards
> Zaher Dirkey
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal