diff --git a/smach/src/smach/concurrence.py b/smach/src/smach/concurrence.py index 621dd48..29ef799 100644 --- a/smach/src/smach/concurrence.py +++ b/smach/src/smach/concurrence.py @@ -276,6 +276,15 @@ def execute(self, parent_ud = None): if children_preempts_serviced: smach.loginfo("Concurrence serviced preempt.") self.service_preempt() + # Cleanup and return preempted + outcome = 'preempted' + self._threads = {} + self._child_outcomes = {} + # Call termination callbacks + self.call_termination_cbs(list(self._states.keys()), outcome) + # Copy output keys + self._copy_output_keys(self.userdata, parent_ud) + return outcome # Spew some debyg info smach.loginfo("Concurrent Outcomes: "+str(self._child_outcomes))