memory leak tips?

Blitz3D Forums/Blitz3D Programming/memory leak tips?

slenkar(Posted 2004) [#1]
any tips for avoiding a memory leak?

e.g. when a type is deleted,is the blitz array inside also deleted?


poopla(Posted 2004) [#2]
Blitz manages destruction of everything inside a type, except for other type instances. SO long as you manually delete every type instance inside a type, then your in the clear.


morduun(Posted 2004) [#3]
Entirely untrue. If you've stored a handle to an image inside one of the type fields and delete its reference type, the image remains unfreed, creating a leak.

In general, creating constructor and destructor functions for types and calling them inline, rather than trying to remember all the details in the midst of other routines, is best.


poopla(Posted 2004) [#4]
I was refering his question up above mostly, but you are correct!

At any rate, I wasn't completely wrong in any way other then the issue of handles. So not entirely untrue ;).


morduun(Posted 2004) [#5]
Ahhhh I see! teaches me (once again) for posting before my first coffee of the day ;) Forgetting to free resources inside type instances does seem to be a common enough failure to make sure it's very clear tho.