Skip to content

Commit 22daba9

Browse files
authored
Merge pull request #200 from JdeRobot/exit-correctly
Exit correctly on Ctrl+C
2 parents b8dfb93 + 195aceb commit 22daba9

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

manager/manager/manager.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,7 @@ def signal_handler(sign, frame):
876876
self.gui_server.stop()
877877
except Exception as e:
878878
LogManager.logger.exception("Exception stopping GUI server")
879+
879880
try:
880881
self.consumer.stop()
881882
except Exception as e:
@@ -886,9 +887,7 @@ def signal_handler(sign, frame):
886887
stop_process_and_children(self.application_process)
887888
self.application_process = None
888889
except Exception as e:
889-
LogManager.logger.exception(
890-
"Exception stopping application process"
891-
)
890+
LogManager.logger.exception("Exception stopping application process")
892891

893892
if self.visualization_launcher:
894893
try:
@@ -902,13 +901,16 @@ def signal_handler(sign, frame):
902901
try:
903902
self.robot_launcher.terminate()
904903
except Exception as e:
905-
LogManager.logger.exception("Exception terminating world launcher")
904+
LogManager.logger.exception("Exception terminating robot launcher")
906905

907906
if self.world_launcher:
908907
try:
909908
self.world_launcher.terminate()
910909
except Exception as e:
911910
LogManager.logger.exception("Exception terminating world launcher")
911+
912+
self.terminate_harmonic_processes()
913+
exit()
912914

913915
signal.signal(signal.SIGINT, signal_handler)
914916

0 commit comments

Comments
 (0)