Skip to content

Commit

Permalink
conditionally try to stop reverse deps, since other reverse deps may …
Browse files Browse the repository at this point in the history
…have already stopped it
  • Loading branch information
wjwwood committed May 24, 2014
1 parent 02fca5e commit e256652
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/capabilities/server.py
Expand Up @@ -624,6 +624,10 @@ def __stop_capability(self, name):
capability = self.__capability_instances[name]
rdepends = get_reverse_depends(name, self.__capability_instances.values())
for cap in rdepends:
if cap.state in ['stopping', 'terminated']:
# It is possible that this cap was stopped by another cap in this list
continue
rospy.loginfo("Capability '{0}' being stopped because its dependency '{1}' is being stopped.".format(cap.name, name))
self.__stop_capability(cap.interface)
capability.stopped()
self.__launch_manager.stop_capability_provider(capability.pid)
Expand Down

0 comments on commit e256652

Please sign in to comment.