When closing the window, disconnect instead of asking the user to do it
Ask confirmation before closing if user has unsent input
Merge pull request #432 from glowing-bear/disconnect-when-closing

When closing the window, disconnect instead of asking the user to do it