Skip to content

Commit

Permalink
fix check period and closeFinishedProcesses, no zombies (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfpulux authored Sep 21, 2024
1 parent 9bcf4e3 commit 8deb6c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/nimdowpkg/event/xeventmanager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,14 @@ proc closeFinishedProcesses*(this: XEventManager) =
## and removes them from the processes seqeunce.
for process in this.processes:
if not process.running():
discard process.waitForExit()
process.close()
this.processes.remove(process)

proc checkForProcessesToClose*(this: XEventManager) =
## Check for closed processes periodically.
currentTime = epochTime()
if timeLastCheckedProcesses - currentTime >= CLOSE_PROCESS_CHECK_INTERVAL:
if currentTime - timeLastCheckedProcesses >= CLOSE_PROCESS_CHECK_INTERVAL:
this.closeFinishedProcesses()
timeLastCheckedProcesses = currentTime

0 comments on commit 8deb6c5

Please sign in to comment.