]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Help out the CPython GC by clearing some references in IOLoop.close.
authorBen Darnell <ben@bendarnell.com>
Mon, 21 Apr 2014 04:26:40 +0000 (00:26 -0400)
committerBen Darnell <ben@bendarnell.com>
Mon, 21 Apr 2014 04:26:40 +0000 (00:26 -0400)
This prevents some of the ResourceWarnings from the test suite on python
3.3 (older versions didn't report the leaks; newer versions are better
at freeing generators).  Since this is in IOLoop.close, it mainly
affects tests.

tornado/ioloop.py

index 208db885342b3c19792c5abab0e1cb5893b6554d..e980a2f06f30741eb2ca286c1c71c891289cebd4 100644 (file)
@@ -592,6 +592,8 @@ class PollIOLoop(IOLoop):
                 self.close_fd(fd)
         self._waker.close()
         self._impl.close()
+        self._callbacks = None
+        self._timeouts = None
 
     def add_handler(self, fd, handler, events):
         fd, obj = self.split_fd(fd)