more protection

This commit is contained in:
Jakob Ketterl 2019-05-10 22:08:18 +02:00
parent 475631a06f
commit b91d24f8d2

View File

@ -88,6 +88,7 @@ class SdrSource(object):
self.clients = [] self.clients = []
self.spectrumClients = [] self.spectrumClients = []
self.spectrumThread = None self.spectrumThread = None
self.process = None
self.modificationLock = threading.Lock() self.modificationLock = threading.Lock()
# override these in subclasses as necessary # override these in subclasses as necessary
@ -184,8 +185,10 @@ class SdrSource(object):
self.modificationLock.acquire() self.modificationLock.acquire()
if self.spectrumThread is not None:
self.spectrumThread.stop() self.spectrumThread.stop()
if self.process is not None:
try: try:
os.killpg(os.getpgid(self.process.pid), signal.SIGTERM) os.killpg(os.getpgid(self.process.pid), signal.SIGTERM)
except ProcessLookupError: except ProcessLookupError: