Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Win32 spawner

I've been trying to figure out why Spawner.kill() isn't killing a process for us. The "process", in our case, is our debugger engine--a Win32 executable. We use the spawner to launch it, and on shutdown,  we sometimes need to abruptly kill it (if it's taking too long to shut down gracefully). Again, calling kill() on the Process object, which is a Spawner, isn't doing the trick.

I found the answer in starter.cpp. It contains a handler which waits for the terminate event-handle to be signaled and then goes about trying to kill the process it earlier created. Problem is: it does so by sending a console CTRL-C event (unless it's a cygwin process, in which case it runs a "kill -SIGTERM" command). In our case, the process is not a cygwin process. The CTRL-C event isn't doing the trick, and I have to wonder...why aren't we just using the TerminateProcess Win32 function? We have the process handle, after all. I've coded it and it's working. I'm just scratching my head wondering why we'd try sending a CTRL-C instead.

John

Back to the top