views:

272

answers:

1

Saw that in some example codes, but ive never used it, unless im dynamically opening new different sized textures etc.

So does my OS or something take care of freeing the texture memory when my app is terminated? Or do i have to free it myself ?

+1  A: 

Like every other resource, most OSes will free them if you don't.

Usually, the reason to do it is to make sure you don't leak any resource while your program is running though. Say for example you load levels, if you don't free all you textures as you keep loading levels, sooner or later, you will run out of memory. Keeping track of leaks is easier if you clean up on exit.

Bahbar