From dfd4cdd75835b25cc702e5728dcc613803d4680e Mon Sep 17 00:00:00 2001 From: sybblow Date: Thu, 25 Sep 2014 20:18:02 +0800 Subject: [PATCH] avoid memory leak Although fd is always the smallest number which haven't been allocated, which means memory leak is quite small. but the worst situation may consume lots of memory. --- shadowsocks/eventloop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadowsocks/eventloop.py b/shadowsocks/eventloop.py index de0039e..4a35950 100644 --- a/shadowsocks/eventloop.py +++ b/shadowsocks/eventloop.py @@ -184,7 +184,7 @@ class EventLoop(object): def remove(self, f): fd = f.fileno() - self._fd_to_f[fd] = None + del self._fd_to_f[fd] self._impl.remove_fd(fd) def modify(self, f, mode):