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 | f850f604702f4aaa10fee934e94600c148e41c6b (patch) | |
| tree | c3292a20bbd2bfe3adc5fcddefb60c106675650f /qpid/python | |
| parent | 24816ab849015f212eb49963c3e08b99dfa700fe (diff) | |
| download | qpid-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.py | 10 |
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: |
