apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mladen Turk" <mt...@mappingsoft.com>
Subject Re: [PATCH] WIN32 Optimistic apr_proc_kill
Date Fri, 15 Feb 2002 23:07:54 GMT

----- Original Message -----
From: "Bill Tutt" <rassilon@lyra.org>
To: "'Mladen Turk'" <mturk@mappingsoft.com>; <dev@apr.apache.org>
Sent: Friday, February 15, 2002 11:44 PM
Subject: RE: [PATCH] WIN32 Optimistic apr_proc_kill

> This isn't a nicer way to kill child processes. While DLL cleanup tasks
> might happen you have no idea whether or not the app you're trying to
> terminate is in a state useful to try this out. The user still might see
> a Win32 generated A/V dialog (or worse) when you do try this trick.
We are calling kill, right?
So If I launch APRized app (myself for example), then on exit the child will
call the apr_terminate that will call the clenup for all the sub-child
processes too! Got It?
The killing of the child doesn't bother me, but that child might created
some own child process. If I kill my own child the rest of them will kepp
> How about this for an alternate suggestion:
> 1) Posting a WM_CLOSE to its window(s) (if any).
>   You can do this by using a combination of EnumWindows, and
> GetWindowThreadProcessID.
> 2) If you don't find any windows try calling GenerateConsoleCtrlEvent
> with CTRL_CLOSE_EVENT, and see if that causes the process to terminate.
If you know what you've lunched you can allways do that explicitly before
calling apr_proc_kill.


View raw message