Final batch of code stability updates before anouther bout of extended testing. Still plenty to go, but making progress.
This commit is contained in:
@ -10,6 +10,7 @@ from threading import Thread, Lock
|
||||
from queue import Queue, Empty
|
||||
import shlex
|
||||
from subprocess import Popen
|
||||
import subprocess
|
||||
from fenrirscreenreader.core.speechDriver import speechDriver
|
||||
|
||||
class speakQueue(Queue):
|
||||
@ -77,10 +78,18 @@ class driver(speechDriver):
|
||||
if self.proc:
|
||||
try:
|
||||
self.proc.terminate()
|
||||
# Wait for process to finish to prevent zombies
|
||||
try:
|
||||
self.proc.wait(timeout=1.0)
|
||||
except subprocess.TimeoutExpired:
|
||||
# If terminate didn't work, force kill
|
||||
self.proc.kill()
|
||||
self.proc.wait(timeout=1.0)
|
||||
except Exception as e:
|
||||
self.env['runtime']['debug'].writeDebugOut('speechDriver:Cancel:self.proc.terminate():' + str(e),debug.debugLevel.WARNING)
|
||||
try:
|
||||
self.proc.kill()
|
||||
self.proc.wait(timeout=1.0) # Wait after kill to prevent zombies
|
||||
except Exception as e:
|
||||
self.env['runtime']['debug'].writeDebugOut('speechDriver:Cancel:self.proc.kill():' + str(e),debug.debugLevel.WARNING)
|
||||
self.proc = None
|
||||
|
Reference in New Issue
Block a user