Skip to content

Commit

Permalink
garbage ServerProxy after telling a node to shutdown (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Sep 19, 2014
1 parent 21097ac commit 2182e51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/rosmaster/src/rosmaster/registrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#
# Revision $Id$

from rosmaster.util import remove_server_proxy
from rosmaster.util import xmlrpcapi
import rosmaster.exceptions

Expand Down Expand Up @@ -127,6 +128,7 @@ def shutdown_node_task(api, caller_id, reason):
xmlrpcapi(api).shutdown('/master', reason)
except:
pass #expected in many common cases
remove_server_proxy(api)

class Registrations(object):
"""
Expand Down
4 changes: 4 additions & 0 deletions tools/rosmaster/src/rosmaster/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ def xmlrpcapi(uri):
_proxies[uri] = ServerProxy(uri)
return _proxies[uri]


def remove_server_proxy(uri):
if uri in _proxies:
del _proxies[uri]

0 comments on commit 2182e51

Please sign in to comment.