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