in reply to Re^4: .exe fails to exit
in thread .exe fails to exit

The first step you will have to do is to reduce your code to a (say) 20 line example that still exhibits the problematic behaviour.

How else should we be able to replicate and understand your situation?