more protection
This commit is contained in:
parent
475631a06f
commit
b91d24f8d2
@ -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,13 +185,15 @@ class SdrSource(object):
|
|||||||
|
|
||||||
self.modificationLock.acquire()
|
self.modificationLock.acquire()
|
||||||
|
|
||||||
self.spectrumThread.stop()
|
if self.spectrumThread is not None:
|
||||||
|
self.spectrumThread.stop()
|
||||||
|
|
||||||
try:
|
if self.process is not None:
|
||||||
os.killpg(os.getpgid(self.process.pid), signal.SIGTERM)
|
try:
|
||||||
except ProcessLookupError:
|
os.killpg(os.getpgid(self.process.pid), signal.SIGTERM)
|
||||||
# been killed by something else, ignore
|
except ProcessLookupError:
|
||||||
pass
|
# been killed by something else, ignore
|
||||||
|
pass
|
||||||
if self.monitor:
|
if self.monitor:
|
||||||
self.monitor.join()
|
self.monitor.join()
|
||||||
self.sleepOnRestart()
|
self.sleepOnRestart()
|
||||||
|
Loading…
Reference in New Issue
Block a user