Skip to content

Commit

Permalink
Fix a closure leak when the JSONRPC asks wether to serve or not
Browse files Browse the repository at this point in the history
Signed-off-by: Steeve Morin <steeve.morin@gmail.com>
  • Loading branch information
steeve committed Jan 22, 2015
1 parent 6ee2ed1 commit 696c51b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions resources/site-packages/pulsar/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,14 @@ def __del__(self):
obj.close()


def _do_serve():
return not xbmc.abortRequested


def server_thread():
import xbmc
import bjsonrpc
try:
s = bjsonrpc.createserver(port=JSONRPC_EXT_PORT, handler_factory=PulsarRPCServer)
s._do_serve = lambda: (not xbmc.abortRequested)
s._do_serve = _do_serve
log.info("pulsar: starting jsonrpc service")
s.serve()
log.info("pulsar: exiting jsonrpc service")
Expand Down

0 comments on commit 696c51b

Please sign in to comment.