I have a small(ish) command-line application that talks to some custom hardware.
Right now, you run the executable, and it pops up a console window, and does it's thing. I'm handling SIGINT
and SIGTERM
so if you hit ctrl+c in the console window, it shuts down gracefully, and releases the custom hardware.
However, if kill the application by simply closing the console window (click the "x" in the corner), it seems to basically be immediately killed, with no time to do any cleanup.
I'd like to be able to do my shutdown procedures if the console is closed. I've not had much luck trying to find out what, exactly, is even happening to my process when it's console is closed.