mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
修复获取frame时重复创建driver,导致线程爆炸的问题
This commit is contained in:
parent
5baa9f217d
commit
563f077964
@ -457,9 +457,10 @@ class Chromium(object):
|
|||||||
:param owner: 使用该驱动的对象
|
:param owner: 使用该驱动的对象
|
||||||
:return: Driver对象
|
:return: Driver对象
|
||||||
"""
|
"""
|
||||||
d = self._drivers.pop(tab_id, None)
|
d = self._drivers.get(tab_id, None)
|
||||||
if not d:
|
if not d:
|
||||||
d = Driver(tab_id, 'page', self.address)
|
d = Driver(tab_id, 'page', self.address)
|
||||||
|
self._drivers[tab_id] = d
|
||||||
d.owner = owner
|
d.owner = owner
|
||||||
self._all_drivers.setdefault(tab_id, set()).add(d)
|
self._all_drivers.setdefault(tab_id, set()).add(d)
|
||||||
return d
|
return d
|
||||||
|
Loading…
x
Reference in New Issue
Block a user