summaryrefslogtreecommitdiff
path: root/qpid/python
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2010-04-06 19:42:38 +0000
committerRafael H. Schloming <rhs@apache.org>2010-04-06 19:42:38 +0000
commitf850f604702f4aaa10fee934e94600c148e41c6b (patch)
treec3292a20bbd2bfe3adc5fcddefb60c106675650f /qpid/python
parent24816ab849015f212eb49963c3e08b99dfa700fe (diff)
downloadqpid-python-f850f604702f4aaa10fee934e94600c148e41c6b.tar.gz
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
Diffstat (limited to 'qpid/python')
-rw-r--r--qpid/python/qpid/messaging/endpoints.py10
1 files changed, 6 insertions, 4 deletions
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: