From 696c51b044b8d212188d29986e7b9908c40c5f33 Mon Sep 17 00:00:00 2001 From: Steeve Morin Date: Thu, 22 Jan 2015 21:27:01 +0100 Subject: [PATCH] Fix a closure leak when the JSONRPC asks wether to serve or not Signed-off-by: Steeve Morin --- resources/site-packages/pulsar/rpc.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/site-packages/pulsar/rpc.py b/resources/site-packages/pulsar/rpc.py index a36a39747..a83e7d0dd 100644 --- a/resources/site-packages/pulsar/rpc.py +++ b/resources/site-packages/pulsar/rpc.py @@ -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")