diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2010-04-06 19:42:38 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2010-04-06 19:42:38 +0000 |
| commit | 021cd2c86a298a8ea0575053a634c1d237b62a95 (patch) | |
| tree | 30311cbfd38e9d198fd0b3cfd2973848f3707e11 /python | |
| parent | cea30bd45679ae39de64cb93e25d914abc937ba0 (diff) | |
| download | qpid-python-021cd2c86a298a8ea0575053a634c1d237b62a95.tar.gz | |
fixed resource leak when close throws an error
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@931286 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
| -rw-r--r-- | python/qpid/messaging/endpoints.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/python/qpid/messaging/endpoints.py b/python/qpid/messaging/endpoints.py index be07c0818f..7ac3881bac 100644 --- a/python/qpid/messaging/endpoints.py +++ b/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: |
