mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 06:29:23 +01:00
test-runner: fix Radio/Interface circular reference
Code was added with commit 04487f575b
which passes a radio object
to the Interface class constructor and stores it in the Interface
object. The radio class also stores each Interface object which
creates a circular reference and causes the Radio to stick around
long after the tests finishes.
I cannot see why the Interface needs to keep track of the Radio
object. None of the wpa_supplicant utilities use this so it has
been removed.
This commit is contained in:
parent
5420fdaf01
commit
c098db1837
@ -246,11 +246,10 @@ class Process:
|
|||||||
raise Exception("Timed out waiting for socket")
|
raise Exception("Timed out waiting for socket")
|
||||||
|
|
||||||
class Interface:
|
class Interface:
|
||||||
def __init__(self, name, config, radio):
|
def __init__(self, name, config):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.ctrl_interface = '/var/run/hostapd/' + name
|
self.ctrl_interface = '/var/run/hostapd/' + name
|
||||||
self.config = config
|
self.config = config
|
||||||
self.radio = radio
|
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
Process(['iw', 'dev', self.name, 'del'], True)
|
Process(['iw', 'dev', self.name, 'del'], True)
|
||||||
@ -276,7 +275,7 @@ class Radio:
|
|||||||
|
|
||||||
intf_id += 1
|
intf_id += 1
|
||||||
|
|
||||||
self.interface = Interface(ifname, config, self)
|
self.interface = Interface(ifname, config)
|
||||||
self.use = use
|
self.use = use
|
||||||
|
|
||||||
Process(['iw', 'phy', self.name, 'interface', 'add', ifname,
|
Process(['iw', 'phy', self.name, 'interface', 'add', ifname,
|
||||||
|
Loading…
Reference in New Issue
Block a user