// My guess is yes, although unsure about the returning main thing. I'm pretty sure things are usually fine after a program ends, or else I'd be quite bothered that I was never warned of this in the C++ books I read!
I figured as much, but then that raises the question of the use of hunting for memory leaks of a program.
Other than to be safe in regards to older OS's.
Obviously if you're running a memory-hungry program, you want to use as little as possible at any given time, but why bother checking to see that you're released all the memory at the end of run-time?
Obviously if you're running a memory-hungry program, you want to use as little as possible at any given time, but why bother checking to see that you're released all the memory at the end of run-time?
Because if there is any chance that it is NOT released by the program itself at the end of the program, that usually means that you have poor code that is full of memory leaks. Memory leaks can bring down any system, no matter how much RAM it has.
Explicitly exempting some object structures from being deleted at program termination can be a design choice for speeding up program termination. But it shouldn't ever be the result of sloppy coding.