Alexandre Fayolle  committed ca5fd84

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.

  • Participants
  • Parent commits 9a93f4f
  • Branches stable

Comments (0)

Files changed (1)

File mercurial/

         _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