Mercurial > public > mercurial-scm > hg
comparison mercurial/url.py @ 12391:ca5fd84d62c6 stable
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.
author | Alexandre Fayolle <alexandre.fayolle@logilab.fr> |
---|---|
date | Thu, 23 Sep 2010 11:41:27 +0200 |
parents | e329c250b0ba |
children | 9d45f78c465b f2937d6492c5 |
comparison
equal
deleted
inserted
replaced
12385:9a93f4fb141b | 12391:ca5fd84d62c6 |
---|---|
467 | 467 |
468 def _start_transaction(self, h, req): | 468 def _start_transaction(self, h, req): |
469 _generic_start_transaction(self, h, req) | 469 _generic_start_transaction(self, h, req) |
470 return keepalive.HTTPHandler._start_transaction(self, h, req) | 470 return keepalive.HTTPHandler._start_transaction(self, h, req) |
471 | 471 |
472 def __del__(self): | |
473 self.close_all() | |
474 | |
475 if has_https: | 472 if has_https: |
476 class BetterHTTPS(httplib.HTTPSConnection): | 473 class BetterHTTPS(httplib.HTTPSConnection): |
477 send = keepalive.safesend | 474 send = keepalive.safesend |
478 | 475 |
479 def connect(self): | 476 def connect(self): |