mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
Deallocate PTY's when they close.
This required a fair bit of plumbing. The CharacterDevice::close() virtual will now be closed by ~FileDescriptor(), allowing device implementations to do custom cleanup at that point. One big problem remains: if the master PTY is closed before the slave PTY, we go into crashy land.
This commit is contained in:
@@ -510,6 +510,11 @@ void VFS::register_character_device(CharacterDevice& device)
|
||||
m_character_devices.set(encodedDevice(device.major(), device.minor()), &device);
|
||||
}
|
||||
|
||||
void VFS::unregister_character_device(CharacterDevice& device)
|
||||
{
|
||||
m_character_devices.remove(encodedDevice(device.major(), device.minor()));
|
||||
}
|
||||
|
||||
void VFS::for_each_mount(Function<void(const Mount&)> callback) const
|
||||
{
|
||||
for (auto& mount : m_mounts) {
|
||||
|
||||
Reference in New Issue
Block a user