From 37e7331627d93beaa221565dd4fdc7cd48c6f3cd Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Thu, 18 Mar 2021 19:47:11 +0100 Subject: [PATCH] fix device failover (concurrent modification problem) --- owrx/source/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/owrx/source/__init__.py b/owrx/source/__init__.py index 0c9b5f6..95812f0 100644 --- a/owrx/source/__init__.py +++ b/owrx/source/__init__.py @@ -153,7 +153,7 @@ class SdrSource(ABC): self.enabled = changes["enabled"] else: self.enabled = True - for c in self.clients: + for c in self.clients.copy(): if self.isEnabled(): c.onEnable() else: @@ -164,7 +164,7 @@ class SdrSource(ABC): def fail(self): self.failed = True - for c in self.clients: + for c in self.clients.copy(): c.onFail() def validateProfiles(self): @@ -420,14 +420,14 @@ class SdrSource(ABC): if state == self.state: return self.state = state - for c in self.clients: + for c in self.clients.copy(): c.onStateChange(state) def setBusyState(self, state: SdrBusyState): if state == self.busyState: return self.busyState = state - for c in self.clients: + for c in self.clients.copy(): c.onBusyStateChange(state)