[Additional answer, after OP's clarification:]
In the "solution" post, OP mentioned that some additional thread does not allow the whole process to terminate. This is the very usual reason.
Just one advice: terminating all the threads before closing main window is the best idea. This way, you can have a full control of the time of termination of abortion of the thread causing the problem. However, in some simple cases when the order of such action is not essential, you can simplify it by making a thread in question a background thread (the name "background" is really misleading). The major difference it makes is: background thread does not prevent the whole process from termination; eventually. such threads will be terminated automatically. Use this property:
http://msdn.microsoft.com/en-us/library/system.threading.thread.isbackground%28v=vs.110%29.aspx[
^].
Again, be careful: you cannot make any assumption when the background thread is automatically terminated, which can create some problems if you somehow rely on that: need to finalize some action, wait for thread termination on some other thread, and so on.
—SA