[fpc-devel] Suggestion: reference counted objects
alfasud.ti at gmail.com
Sun Sep 28 21:00:13 CEST 2014
On Sat, Sep 27, 2014 at 7:33 PM, Sven Barth <pascaldragon at googlemail.com>
> Huh? Delphi really prohibits such things inside the destructor? Would you
> mind to share an example (possibly including error messages), please?
Sorry, I wasn't clear enough.
With "prohibits" I didn't mean that you get a compiler error. It compiles
and runs just fine but you get a stack overflow at runtime
when the dest
ructor is called
I've done a different approach already: the decrease helper sets refcount
> to -1 directly before it calls the destructor and both the increase and the
> decrease helper check for -1. Considering that it's currently only a proof
> of concept I can live with the performance impact that comparison might
OK, but keep my proposal in mind since it has overhead only at
BeforeDestruction which is once per instance lifecycle.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel