From f850f604702f4aaa10fee934e94600c148e41c6b Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Tue, 6 Apr 2010 19:42:38 +0000 Subject: fixed resource leak when close throws an error git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@931286 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/python/qpid/messaging/endpoints.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'qpid/python') diff --git a/qpid/python/qpid/messaging/endpoints.py b/qpid/python/qpid/messaging/endpoints.py index be07c0818f..7ac3881bac 100644 --- a/qpid/python/qpid/messaging/endpoints.py +++ b/qpid/python/qpid/messaging/endpoints.py @@ -187,7 +187,7 @@ class Connection: """ self._connected = False self._wakeup() - self._ewait(lambda: not self._transport_connected) + self._wait(lambda: not self._transport_connected) self._driver.stop() self._condition.gc() @@ -203,9 +203,11 @@ class Connection: """ Close the connection and all sessions. """ - for ssn in self.sessions.values(): - ssn.close() - self.disconnect() + try: + for ssn in self.sessions.values(): + ssn.close() + finally: + self.disconnect() class Session: -- cgit v1.2.1