diff options
-rw-r--r-- | python/qpid/peer.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/python/qpid/peer.py b/python/qpid/peer.py index b6b528f12c..888ec7b133 100644 --- a/python/qpid/peer.py +++ b/python/qpid/peer.py @@ -97,9 +97,12 @@ class Peer: self.fatal() def close(self, reason): + # We must close the delegate first because closing channels + # may wake up waiting threads and we don't want them to see + # the delegate as open. + self.delegate.close(reason) for ch in self.channels.values(): ch.close(reason) - self.delegate.close(reason) def writer(self): try: |