Quote:Original post by iMalc
Not to mention that anything not freed upon program termination is normally automatically reclaimed by the OS, so this cliff already has a massive air-bag at the bottom.
For this reason, cleanup on termination is a non-issue almost everywhere.
If you have an underlying OS (Win/Mac/Linux, iPhone, etc.) then resources will be automatically reclaimed after a crash*. If you don't have an OS (i.e. an embedded platform), then you typically have to reboot the machine anyway after a crash, so leaked resources will simply cease to exist.
* there are a few resources that can't be reclaimed by the OS, notably Unix/Linux semaphores. However, if you are at the point of using semaphores, you probably know enough to handle errors correctly...