View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0035527||Lazarus||LazUtils||public||2019-05-06 10:08||2020-04-26 18:52|
|Reporter||Fedon Kadifeli||Assigned To|
|Product Version||2.1 (SVN)|
|Summary||0035527: openDocument and openURL leave zombie processes|
|Description||Each time I call openDocument to open a file or openURL to open a web address in the default browser, I see accumulating defunct processes. The parent process of these is my calling program. The underlying code of these procedures should wait for xdg-open process to return.|
To solve this, I added the following line to file components/lazutils/utf8process.pp, line 234 (at procedure RunCmdFromPath):
BrowserProcess.Options := BrowserProcess.Options + [poWaitOnExit];
|Steps To Reproduce||Run a code like this in a Lazarus program:|
Gedit will open. Without closing the calling Lazarus program, run the following bash command
ps -ef | grep -i defunct
A defunct process (child of the Lazarus program) will appear.
|Additional Information||Discussed in https://forum.lazarus.freepascal.org/index.php?topic=45271|
|Tags||No tags attached.|
|Fixed in Revision|
||I just wanted to inform you that this problem still persists in Lazarus 2.0.8 too.|
Its best if not yet implemented to simply return a handle that can be used in your app so that it can be tracked and close from your app's end...
I use OpenUrl and I don't want it hanging there holding up the process.
I guess the other option is to have a variant of it with a user request to lock the other processes while up.