You've already forked RadioPlayer
mirror of
https://github.com/radio95-rnt/RadioPlayer.git
synced 2026-02-26 21:53:54 +01:00
prevent zombie processes
This commit is contained in:
@@ -28,7 +28,13 @@ class ProcessManager(ABC_ProcessManager):
|
||||
return pr
|
||||
def anything_playing(self) -> bool:
|
||||
with self.lock:
|
||||
self.processes = [p for p in self.processes if p.process.poll() is None]
|
||||
alive = []
|
||||
for p in self.processes:
|
||||
if p.process.poll() is None: alive.append(p)
|
||||
else:
|
||||
try: p.process.wait(timeout=0)
|
||||
except subprocess.TimeoutExpired: pass
|
||||
self.processes = alive
|
||||
return bool(self.processes)
|
||||
def stop_all(self, timeout: float | None = None) -> None:
|
||||
with self.lock:
|
||||
|
||||
Reference in New Issue
Block a user