diff --git a/robotics_application_manager/manager/launcher/launcher_o3de_api.py b/robotics_application_manager/manager/launcher/launcher_o3de_api.py index e6f2ade..d8803d0 100644 --- a/robotics_application_manager/manager/launcher/launcher_o3de_api.py +++ b/robotics_application_manager/manager/launcher/launcher_o3de_api.py @@ -71,7 +71,7 @@ def run(self, callback): def terminate(self): self.gz_vnc.terminate() if self.threads is not None: - for thread in self.threads: + for thread in self.threads[:]: if thread.is_alive(): thread.terminate() thread.join() diff --git a/robotics_application_manager/manager/vnc/vnc_server.py b/robotics_application_manager/manager/vnc/vnc_server.py index da05946..c554299 100755 --- a/robotics_application_manager/manager/vnc/vnc_server.py +++ b/robotics_application_manager/manager/vnc/vnc_server.py @@ -153,7 +153,7 @@ def is_running(self): def terminate(self): """Terminate all running threads and stop the VNC server.""" - for thread in self.threads: + for thread in self.threads[:]: if thread.is_alive(): thread.terminate() thread.join()