From e811959588389e374caf60270f86b37dce94c889 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 4 Sep 2011 18:47:01 +0200 Subject: [PATCH] Fix the IOStream close callback not getting called if there are pending callbacks. _maybe_add_error_listener only does anything if _state is None. --- tornado/iostream.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tornado/iostream.py b/tornado/iostream.py index 5869ec8c0..122614a69 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -224,6 +224,7 @@ class IOStream(object): self._consume(self._read_buffer_size)) if self._state is not None: self.io_loop.remove_handler(self.socket.fileno()) + self._state = None self.socket.close() self.socket = None if self._close_callback and self._pending_callbacks == 0: -- 2.47.2