clearworld and types

Blitz3D Forums/Blitz3D Beginners Area/clearworld and types

I always try to design my code that a clear world is unnecessary by including an unload and a load function after and before my 'core loop'. Usually I store references to all entity handles, texture handles, pivots, sounds, music etc in types and/or banks then manually free them as required. It is not too hard with a bit of forethought to design your system so that there are no memory leaks and that resources are managed such that it is easy to free them all and unfree them. What can complicate matters is if you are using external libs which include calls to 'clearworld' in their cleanup code.