SeleniumHQ/selenium — pull request #215 by kcm1700 (2014-05-07 01:13:20+00:00)
Title: issue #7304 Fix memory leak caused by __del__ in PhantomJS

issue #7304 here: https://code.google.com/p/selenium/issues/detail?id=7304

CPython 2.7 cannot collect garbage in the following situation.
(arrow means reference)

A <--> B(__del__ defined) --> C(__del__ defined)

8fc478b0 have added new circular reference A <-> B in this situation.

A: switch_to
B: webdriver (in the module PhantomJS)
C: subprocess.Popen (used by phantomjs/service)

In order to fix the issue #7304, moving __del__ into service class
is necessary. __del__ defined class is not anymore in a reference cycle.