# HG changeset patch # User Alexandre Fayolle # Date 2010-09-23 09:41:27 # Node ID ca5fd84d62c6b9f1f84c5547db2794b72786c014 # Parent 9a93f4fb141b89412084fcd23a03a09b11d43fbf Fix memory leak when using hg commands over http repositories When using hg commands over an http repository in a long running process, a httphandler instance is leaked for each command, because of a loop handler.parent -> OpenerDirector and OpenerDirector.handlers -> handler which is not handled by Python's gc. Discussion on #mercurial concluded that removing the __del__ method solved the problem. diff --git a/mercurial/url.py b/mercurial/url.py --- a/mercurial/url.py +++ b/mercurial/url.py @@ -469,9 +469,6 @@ class httphandler(keepalive.HTTPHandler) _generic_start_transaction(self, h, req) return keepalive.HTTPHandler._start_transaction(self, h, req) - def __del__(self): - self.close_all() - if has_https: class BetterHTTPS(httplib.HTTPSConnection): send = keepalive.safesend