[fpc-pascal] How are Assigned, Free, Nil and Destroy related?
Ludo Brands
ludo.brands at free.fr
Sat Oct 22 09:50:01 CEST 2011
Does that mean that Free itself reclaims the memory used by the object's
fields and properties but does not release the memory used by the TObject or
pointer itself, where as setting it to nil or executing Destroy does, or
does Destroy do something different?
All memory is released including TObject but the variable pointing to the
TObject (fe: SCStrings) isn't set to nil. It still points to where the
TObject was. Warning: setting a TObject variable to nil does not free the
object unless it is reference counted! Strings and COM style interfaces are
reference counted. Pascal is not VB.
Ludo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20111022/1d9fb8f3/attachment.html>
More information about the fpc-pascal
mailing list