Why is Self=Null wrong?

BlitzMax Forums/BlitzMax Beginners Area/Why is Self=Null wrong?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

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...