memory release: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: memory release
| Old | New | Line | |
|---|---|---|---|
| 1 | + | # Shared objects | |
| 2 | + | ||
| 3 | + | - **Destroy** releases the storage space (an object). | |
| 4 | + | - **Free** checks whether the object reference is nil. If the object reference is **not** nil, the storage space (the object) is released. This procedure prevents exceptions when releasing the storage space. | |
| 5 | + | - **Nil** deletes the reference to an object. Note: The object should be released beforehand, otherwise so-called memory leaks occur. | |
| 6 | + | - **FreeAndNil** works like **Free** and afterwards sets the object reference (the pointer) to nil. | |
| 7 | + | ||
| 8 | + | # Pointers | |
| 9 | + | ||
| 10 | + | - **Dispose** releases the memory for typed pointers that were created with **New**. | |
| 11 | + | - **FreeMem** releases the memory for untyped pointers that were created with **GetMem**. | |
| 12 | + | ||
| 13 | + | --- | |
| 14 | + | *From the Free Pascal wiki, page "memory release", as it stood on 2020-02-12 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
