The problem is that not everything that you can somehow take on is listed in the standard as purification.
For example, many programs and libraries do things such as creating lock files, starting background processes, changing system settings, etc. They can be cleaned up by the OS if you call exit , but they are optional. Failure to comply with these functions can have consequences, from the inability to restart the program (typical for lock files) to a complete system crash (less likely, but possible in some cases).
True, on the topic of a joke. I used to use OIS , the input library for my project. Every time I killed my program in the debugger, key repetition was broken throughout the system, because OIS temporarily disabled it in Linux. I fixed this by changing the settings (and later completely resetting OIS), but this illustrates very well the problems you might encounter when calling exit before you clean your environment yourself.
user3995702
source share