The question in the title does not refer to the actions you take when you are about to exit your application, issues like logging, closing file handles, freeing unmanaged resources and so on. It does literally refer to the exit action itself:
The idea for that post came to my mind after I had to solve a weird bug where pressing the Exit button led to a freeze in an application that I work on. It turned out that I was not using the proper Exit method although I was aware to the fact that there are 2 possibilities. Sometimes, when you are in a middle of a coding momentum, writing a lot of code, you can miss the little details. Those will come back to hunt you later on, and the most difficult thing about it is that everything was functioning fine for about a year before the bug showed his ugly face.
Lets first understand the difference between the 2 Exit methods:
We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution
Learn More