On 29.10.2014 15:56, [email protected] 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
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to