Fix memory leak when destroying libev connections
The IO objects held a reference to their LibevConnection instances through the callback. This reference cycle was preventing the connection from being garbage collected. Fixes #93
This commit is contained in:
@@ -12,6 +12,8 @@ Bug Fixes
|
||||
with shared state when using multiprocessing (PYTHON-60)
|
||||
* Add python-six to debian dependencies, move python-blist to
|
||||
recommends
|
||||
* Fix memory leak when libev connections are created and
|
||||
destroyed (github #93)
|
||||
|
||||
2.0.1
|
||||
=====
|
||||
|
||||
@@ -187,8 +187,12 @@ class LibevLoop(object):
|
||||
for conn in to_stop:
|
||||
if conn._write_watcher:
|
||||
conn._write_watcher.stop()
|
||||
# clear reference cycles from IO callback
|
||||
del conn._write_watcher
|
||||
if conn._read_watcher:
|
||||
conn._read_watcher.stop()
|
||||
# clear reference cycles from IO callback
|
||||
del conn._read_watcher
|
||||
|
||||
changed = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user