Fix #1123 - leaking socket after quit()
This commit is contained in:
parent
bf7dcf8b57
commit
5f750017b7
|
@ -709,6 +709,8 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
|
||||||
def quit(self):
|
def quit(self):
|
||||||
try:
|
try:
|
||||||
self.service.process.kill()
|
self.service.process.kill()
|
||||||
|
# has to be closed manually, otherwise socket to driver process gets leaked in CLOSE_WAIT
|
||||||
|
self.command_executor.close()
|
||||||
logger.debug("webdriver process ended")
|
logger.debug("webdriver process ended")
|
||||||
except (AttributeError, RuntimeError, OSError):
|
except (AttributeError, RuntimeError, OSError):
|
||||||
pass
|
pass
|
||||||
|
@ -783,6 +785,7 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
try:
|
try:
|
||||||
self.service.process.kill()
|
self.service.process.kill()
|
||||||
|
self.command_executor.close()
|
||||||
except: # noqa
|
except: # noqa
|
||||||
pass
|
pass
|
||||||
self.quit()
|
self.quit()
|
||||||
|
|
Loading…
Reference in New Issue