[fpc-devel] Suggestion: reference counted objects
Hans-Peter Diettrich
DrDiettrich1 at aol.com
Sat Sep 27 16:06:14 CEST 2014
Sven Barth schrieb:
> There are however some nasty problems inside constructors and
> destructors, because "Self" is reference counted as well (and should be
> after all as we don't want the instance to be destroyed behind our backs
> suddenly).
IMO before the end of a constructor, and before the start of an
destructor, no references to the object exist at all, so that code
outside these methods has no reference that could cause trouble.
It looks to me like inside methods Self doesn't deserve refcounting,
because a method can be invoked only with an existing instance, which
will stay alive at least until the call returns.
DoDi
More information about the fpc-devel
mailing list