[Lazarus] TAsyncProcess.OnTerminate doesn't fire

Tom Lisjac zikon770 at gmail.com
Sat Oct 11 20:39:30 CEST 2008


On Sat, Oct 11, 2008 at 4:13 AM, Micha Nelissen <micha at neli.hopto.org> wrote:
> Tom Lisjac wrote:
>> The TAsyncProcess option set in the test code below executes and
>> terminates without leaving a zombie process, but the OnTerminate event
>> never fires. I've tried a variety of options including just
>> [poUsePipes,poStderrToOutPut] but have yet to see the OnTerminate
>> event.
>
> What Widgetset are you using?

I'm using the default gtk on Linux and an svn from Sept 14th.

> You should not use poWaitOnExit because that basically destroys the idea
> of asynchronous ;-).

I would agree if OnTerminate was working... otherwise how does the app
know that the async process has completed? :)

I've also noticed that without poWaitOnExit, the processes die and
leave zombies in the process tree:

root      2356  0.0  0.0      0     0 ?        Z    12:09   0:00 [ls] <defunct>
root      2357  0.0  0.0      0     0 ?        Z    12:09   0:00 [ls] <defunct>
root      2358  0.0  0.0      0     0 ?        Z    12:09   0:00 [ls] <defunct>
root      2359  0.0  0.0      0     0 ?        Z    12:09   0:00 [ls] <defunct>

I haven't decided if I can live with this in the final version and may
have to give up on the async feature. Although zombies are harmless,
hundreds of them attached to the Lazarus parent may look a little
scary to tech aware end users.

The zombies are a minor issue, however. Knowing when the async process
terminates is the part of the puzzle I don't have as yet.

Thanks for the reply.

-Tom



More information about the Lazarus mailing list