From 9fd8d787028b7ad349327409cf78658c76f5804d Mon Sep 17 00:00:00 2001 From: ThomasV Date: Mon, 25 Nov 2013 18:25:47 +0400 Subject: [PATCH] fix another memory leak --- processor.py | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/processor.py b/processor.py index ec62d48..0ad86ff 100644 --- a/processor.py +++ b/processor.py @@ -177,9 +177,14 @@ class RequestDispatcher(threading.Thread): sessions = self.sessions[:] active_sessions = [] + now = time.time() for session in sessions: - if not session.stopped() and (now - session.time) < 1000: + if (now - session.time) > 1000: + session.stop() + + for session in sessions: + if not session.stopped(): # If session is still alive then re-add it back # to our internal register active_sessions.append(session) -- 1.7.1