修复获取frame时重复创建driver,导致线程爆炸的问题

This commit is contained in:
lyousan 2024-07-23 01:40:32 +08:00
parent 5baa9f217d
commit 563f077964

View File

@ -457,9 +457,10 @@ class Chromium(object):
:param owner: 使用该驱动的对象
:return: Driver对象
"""
d = self._drivers.pop(tab_id, None)
d = self._drivers.get(tab_id, None)
if not d:
d = Driver(tab_id, 'page', self.address)
self._drivers[tab_id] = d
d.owner = owner
self._all_drivers.setdefault(tab_id, set()).add(d)
return d