1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:37:34 +00:00

Kernel/VirtIO: Stop leaking VirtIO::ConsolePort objects

This commit is contained in:
Andreas Kling 2021-09-03 02:23:49 +02:00
parent eaf88cc78a
commit 8a89698ea4

View file

@ -53,7 +53,7 @@ UNMAP_AFTER_INIT Console::Console(PCI::Address address)
if (is_feature_accepted(VIRTIO_CONSOLE_F_MULTIPORT))
setup_multiport();
else
m_ports.append(new VirtIO::ConsolePort(0u, *this));
m_ports.append(make_ref_counted<VirtIO::ConsolePort>(0u, *this));
}
}
}
@ -150,7 +150,7 @@ void Console::process_control_message(ControlMessage message)
return;
}
m_ports.at(id) = new VirtIO::ConsolePort(id, *this);
m_ports.at(id) = make_ref_counted<VirtIO::ConsolePort>(id, *this);
ControlMessage ready_event {
.id = static_cast<u32>(id),
.event = (u16)ControlEvent::PortReady,