[fpc-devel] Proof of Concept ARC implementation

Sven Barth pascaldragon at googlemail.com
Wed Oct 29 16:41:27 CET 2014


On 29.10.2014 15:56, hinstance at yandex.ru wrote:
> however mandatory explicit casting is also a viable option:
>
> thing := TObject(refThing);  // okay, compiler, I know what I'm doing, now do your thing, cast this for me

Mandatory explicit typecasts would indeed be an option. This way one 
would (hopefully) know that this assignment might influence the 
reference count and that one should do the necessary precautions (e.g. 
manually increasing the reference count) beforehand. Of course depending 
on the usage of the object it might still lead to memory leaks, because 
that additional reference never gets released...

Regards,
Sven



More information about the fpc-devel mailing list