Fix a major memory leak when using the libevent or libev hubs. Timers were not being removed from the hub after they fired. (Thanks Agusto Becciu).

This commit is contained in:
donovan
2008-07-14 12:42:41 -07:00
parent c167061759
commit 9f31852ad4
3 changed files with 7 additions and 1 deletions

2
NEWS
View File

@@ -5,6 +5,8 @@ Fixes some long-standing bugs where sometimes failures in accept() or connect()
0.6.1: Added eventlet.tpool.killall. Blocks until all of the threadpool threads have been told to exit and join()ed. Meant to be used to clean up the threadpool on exit or if calling execv. Used by Spawning.
0.6.2: Fix a major memory leak when using the libevent or libev hubs. Timers were not being removed from the hub after they fired. (Thanks Agusto Becciu).
0.5.x
=====

View File

@@ -40,6 +40,7 @@ class Timer(object):
This timer will not be run unless it is scheduled in a runloop by
calling timer.schedule() or runloop.add_timer(timer).
"""
self.impltimer = None
self.cancelled = False
self.seconds = seconds
self.tpl = cb, args, kw
@@ -72,6 +73,9 @@ class Timer(object):
def __call__(self, *args):
if not self.called:
self.called = True
if self.impltimer is not None:
del get_hub().timers_by_greenlet[self.greenlet][self]
cb, args, kw = self.tpl
cb(*args, **kw)

View File

@@ -6,7 +6,7 @@ from setuptools import find_packages, setup
setup(
name='eventlet',
version='0.6.1',
version='0.6.2pre',
description='Coroutine-based networking library',
author='Linden Lab',
author_email='eventletdev@lists.secondlife.com',