Skip to content

Commit

Permalink
Fix the IOStream close callback not getting called if there are pendi…
Browse files Browse the repository at this point in the history
…ng callbacks.

_maybe_add_error_listener only does anything if _state is None.
  • Loading branch information
flodiebold authored and bdarnell committed Sep 18, 2011
1 parent 95b7073 commit e811959
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tornado/iostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ def close(self):
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:
Expand Down

0 comments on commit e811959

Please sign in to comment.