fix device failover (concurrent modification problem)
This commit is contained in:
parent
b25a673829
commit
37e7331627
@ -153,7 +153,7 @@ class SdrSource(ABC):
|
|||||||
self.enabled = changes["enabled"]
|
self.enabled = changes["enabled"]
|
||||||
else:
|
else:
|
||||||
self.enabled = True
|
self.enabled = True
|
||||||
for c in self.clients:
|
for c in self.clients.copy():
|
||||||
if self.isEnabled():
|
if self.isEnabled():
|
||||||
c.onEnable()
|
c.onEnable()
|
||||||
else:
|
else:
|
||||||
@ -164,7 +164,7 @@ class SdrSource(ABC):
|
|||||||
|
|
||||||
def fail(self):
|
def fail(self):
|
||||||
self.failed = True
|
self.failed = True
|
||||||
for c in self.clients:
|
for c in self.clients.copy():
|
||||||
c.onFail()
|
c.onFail()
|
||||||
|
|
||||||
def validateProfiles(self):
|
def validateProfiles(self):
|
||||||
@ -420,14 +420,14 @@ class SdrSource(ABC):
|
|||||||
if state == self.state:
|
if state == self.state:
|
||||||
return
|
return
|
||||||
self.state = state
|
self.state = state
|
||||||
for c in self.clients:
|
for c in self.clients.copy():
|
||||||
c.onStateChange(state)
|
c.onStateChange(state)
|
||||||
|
|
||||||
def setBusyState(self, state: SdrBusyState):
|
def setBusyState(self, state: SdrBusyState):
|
||||||
if state == self.busyState:
|
if state == self.busyState:
|
||||||
return
|
return
|
||||||
self.busyState = state
|
self.busyState = state
|
||||||
for c in self.clients:
|
for c in self.clients.copy():
|
||||||
c.onBusyStateChange(state)
|
c.onBusyStateChange(state)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user