deleting types

BlitzMax Forums/BlitzMax Programming/deleting types

PS: Flushmem within function is very evil and a guarantee for memory leaks. So you should avoid to use if at other places then your main loop if the function will be called more then a single time (initialization / clean up of levels or application)


Are you sure about that? According to the docs, FlushMem only frees objects allocated in the same scope or in deeper scopes than the FlushMem call itself.

This means that you can use FlushMem in methods or functions, just remember that it won't free objects allocated outside of the function / method - to do that you have to call FlushMem at the global scope.