freeing
BlitzMax Forums/BlitzMax Beginners Area/freeing
| ||
how do i free an image and a pixmap?!? |
| ||
Remove them from any list then either let them drop out of scope or null/reuse the variable. |
| ||
To clear that up: you don't do it manually. It is freed, when it isn't reference anymore (when using :TImage and :TPixmap etc which you should. Doing it the old blitz way with int handles is several times slower because it has no optimized memory handling as typed with its garbage collector) |
| ||
Wow, i like that :) |
| ||
One thing to bear in mind. Say for whatever reason you alias an object i.e. you make a variable that points at it. If you null that variable, the object still exists until you null the original variable e.g.MyObject = TImage a:TImage = MyObject 'alias a = null 'it's not freed yet MyObject = null 'it is freed now |
| ||
Mark explains this all quite clearly here in the Wiki - http://www.blitzwiki.org/index.php/Memory_management :) |