Why free memory on application quit?
It's mostly a question of good practice. You allocate, you free. In some cases, this can save you a bunch of headaches if you ever want to change a number of global constructs to ephemeral ones.
The other main use is memory leak tracking. If your application is supposed to delete everything before quitting, then anything remaining right before quitting is necessarily a leak, QED. With full memory freeing, there is no possible confusion between a leak and global memory.
The other main use is memory leak tracking. If your application is supposed to delete everything before quitting, then anything remaining right before quitting is necessarily a leak, QED. With full memory freeing, there is no possible confusion between a leak and global memory.
- Sohta
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| My game crashes on quit... | hangt5 | 17 | 7,767 |
Jan 30, 2005 09:38 PM Last Post: hangt5 |
|
| Carbon Apple quit Event troubles | deekpyro | 3 | 5,000 |
May 7, 2002 06:24 AM Last Post: deekpyro |
|

