Net: Make NetworkAdapter reference-counted

The idea behind WeakPtr<NetworkAdapter> was to support hot-pluggable
network adapters, but on closer thought, that's super impractical so
let's not go down that road.
This commit is contained in:
Andreas Kling 2020-02-08 00:19:46 +01:00
commit a3f39fe789
Notes: sideshowbarker 2024-07-19 09:32:30 +09:00
7 changed files with 19 additions and 19 deletions

View file

@ -132,7 +132,7 @@ void RTL8139NetworkAdapter::detect(const PCI::Address& address)
if (id != rtl8139_id)
return;
u8 irq = PCI::get_interrupt_line(address);
new RTL8139NetworkAdapter(address, irq);
(void)adopt(*new RTL8139NetworkAdapter(address, irq)).leak_ref();
}
RTL8139NetworkAdapter::RTL8139NetworkAdapter(PCI::Address pci_address, u8 irq)