memory leak tips?
Blitz3D Forums/Blitz3D Programming/memory leak tips?
| ||
any tips for avoiding a memory leak? e.g. when a type is deleted,is the blitz array inside also deleted? |
| ||
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. |
| ||
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. |
| ||
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 ;). |
| ||
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. |