setting it to null doesn't actually free it though.
All null does is set the handle to null
Once the object has no handles, it is destroyed by flushmem. This way you cannot have memory problems by trying to access something that's been freed. In many cases an object will only have one handle. this is why "=null" works. Handles can also go out of scope (especially in strict mode). Just dont worry about it, set all handles you wont need afterwords to null and flushmem occasionally. The only time you really have to worry about it is with cyclic types like TList...
All null does is set the handle to null
Once the object has no handles, it is destroyed by flushmem. This way you cannot have memory problems by trying to access something that's been freed. In many cases an object will only have one handle. this is why "=null" works. Handles can also go out of scope (especially in strict mode). Just dont worry about it, set all handles you wont need afterwords to null and flushmem occasionally. The only time you really have to worry about it is with cyclic types like TList...