Repository: qpid-proton Updated Branches: refs/heads/master 07dc168b5 -> a8c947399
PROTON-1000: break circularites via receiver handler Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/9cf3ab8e Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/9cf3ab8e Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/9cf3ab8e Branch: refs/heads/master Commit: 9cf3ab8ee0096d60629c6cec440421c1a4892cb0 Parents: 07dc168 Author: Gordon Sim <[email protected]> Authored: Fri Nov 6 18:15:30 2015 +0000 Committer: Gordon Sim <[email protected]> Committed: Fri Nov 6 18:15:30 2015 +0000 ---------------------------------------------------------------------- proton-c/bindings/python/proton/utils.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/9cf3ab8e/proton-c/bindings/python/proton/utils.py ---------------------------------------------------------------------- diff --git a/proton-c/bindings/python/proton/utils.py b/proton-c/bindings/python/proton/utils.py index bc44adf..5094285 100644 --- a/proton-c/bindings/python/proton/utils.py +++ b/proton-c/bindings/python/proton/utils.py @@ -131,6 +131,10 @@ class BlockingReceiver(BlockingLink): if credit: receiver.flow(credit) self.fetcher = fetcher + def __del__(self): + self.fetcher = None + self.link.handler = None + def receive(self, timeout=False): if not self.fetcher: raise Exception("Can't call receive on this receiver as a handler was provided") @@ -217,8 +221,12 @@ class BlockingConnection(Handler): def close(self): self.conn.close() - self.wait(lambda: not (self.conn.state & Endpoint.REMOTE_ACTIVE), - msg="Closing connection") + try: + self.wait(lambda: not (self.conn.state & Endpoint.REMOTE_ACTIVE), + msg="Closing connection") + finally: + self.conn = None + self.container = None def _is_closed(self): return self.conn.state & (Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
