Skip to content

Commit

Permalink
fix: runner chromeapp on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
manatlan authored Nov 1, 2023
1 parent 6836352 commit 61ca2da
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions htag/runners/chromeapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class FULLSCREEN: pass

class _ChromeApp:
def __init__(self, url, appname="driver",size=None,lockPort=None,chromeargs=[]):

self._p=None

def find_chrome_win():
import winreg # TODO: pip3 install winreg

Expand Down Expand Up @@ -118,10 +119,12 @@ def find_chrome_mac():
#~ self._ws = None

def wait(self):
self._p.wait()
if self._p:
self._p.wait()

def __del__(self): # really important !
self._p.kill()
if self._p:
self._p.kill()
if self.cacheFolderToRemove: shutil.rmtree(self.cacheFolderToRemove, ignore_errors=True)

#~ def _com(self, payload: dict):
Expand All @@ -138,7 +141,8 @@ def __del__(self): # really important !

def exit(self):
#~ self._com(dict(method="Browser.close"))
self._p.kill()
if self._p:
self._p.kill()
#="="="="="="="="="="="="="="="="="="="="="="="="="="="="="="="="="="="="="="="


Expand Down

0 comments on commit 61ca2da

Please sign in to comment.