summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordonovan <donovan@ell-ee-dee.local>2008-07-14 12:42:41 -0700
committerdonovan <donovan@ell-ee-dee.local>2008-07-14 12:42:41 -0700
commit9f31852ad4512f391e5e89ee7d97f218a00505fe (patch)
treee3324e80aa376a13ebc67192ce0cfb6f07932361
parentc167061759dad09b3ad90296aebf9a7e40d48943 (diff)
downloadeventlet-9f31852ad4512f391e5e89ee7d97f218a00505fe.tar.gz
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).
-rw-r--r--NEWS2
-rw-r--r--eventlet/timer.py4
-rw-r--r--setup.py2
3 files changed, 7 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 39c67ac..bffaada 100644
--- a/NEWS
+++ b/NEWS
@@ -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
=====
diff --git a/eventlet/timer.py b/eventlet/timer.py
index 6e41a18..1018320 100644
--- a/eventlet/timer.py
+++ b/eventlet/timer.py
@@ -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)
diff --git a/setup.py b/setup.py
index 0bf1313..3e82c55 100644
--- a/setup.py
+++ b/setup.py
@@ -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',