Yes, you can avoid releasing any resource manually which the runtime or the OS will clean up after you.
Still, do not do so please.
It is a valid optimisation for faster shutdown (and sometimes even for faster execution in exchange for memory consumption), though you must be picky about which resources you leave around:
- Memory and file descriptors are efficiently handled by the OS (ancient platforms not doing so have mostly succumbed to disuse. Still, there are a few tiny systems not able to free this).
FILE
buffers are efficiently cleaned up by the runtime.
- Windows GUI resources are not efficiently cleaned up this way, it needs longer.
Anyway, do the cleanup and develop the right mind-set, it makes searching for leaks much easier and is better transferable to bigger and longer-running tasks.
Premature optimisation is the root of all evil. (The expert only option to optimise after measurement and careful consideration does not apply yet)