[fpc-devel] Suggestion: reference counted objects

Michael Schnell mschnell at lumino.de
Thu Sep 25 12:13:53 CEST 2014


On 09/25/2014 11:55 AM, Sven Barth wrote:
>
>
> Why should it? When the reference count is decreased to zero (and thus 
> the final reference on the instance is gone) the destructor method is 
> executed (which is just a "obj.Destroy;"), simple as that (in reality 
> it's a bit more complex, but that's an implementation detail).
>
Nice.

I already used "locally anonymous" Objects  created by one thread and 
freed by another after a certain procedure had been called to implement 
inter-Thread events. Maybe with ref-Counted Objects this can be done in 
a more sexy way.

-Michael



More information about the fpc-devel mailing list