First off, let me start by saying that I understand all the perils of calling TerminateThread from outside a thread, instead of signaling the thread to quit by itself & wait for that to happen.
My question is, can I call TerminateThread right before the app quit. There's a 100% guarantee that the app will quit at that very moment. Do I risk to incur a memory leak in this case? Or anything that should prevent me from calling that API in this particular situation?
PS. I want to call it to let the application quit faster. It is too long to explain, but I need this app to quit ASAP upon a certain condition. (The app is a screensaver and should close as soon as a user moves the mouse.)