Right now, when the user want to exit my application, I do the few things I have to (ie disconnecting from the server, saving the user data...) and then I do the following :
- Exit all my mainloops using booleans
- abort the threads still running (typically, my server polling thread)
- kindly call Application.Exit();
This takes a few seconds to exit, and serves no real purpose (everything is already saved on the server, so I don't really care what happens there)
If I use this instead, I got instant termination with no drawback I can think of :
System.Diagnostics.Process.GetCurrentProcess().Kill();
Why wouldn't I just terminate my process and let the CLR drop the AppDomain ?
I know that carefully disposing your shared resources (IO file handlers, etc.) is important (so please don't answer that:)), but once it's done, is there a real reason to cleanly exit my App ?