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):
|
||||
try:
|
||||
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")
|
||||
except (AttributeError, RuntimeError, OSError):
|
||||
pass
|
||||
|
@ -783,6 +785,7 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
|
|||
def __del__(self):
|
||||
try:
|
||||
self.service.process.kill()
|
||||
self.command_executor.close()
|
||||
except: # noqa
|
||||
pass
|
||||
self.quit()
|
||||
|
|
Loading…
Reference in New Issue