mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-04-26 22:42:28 +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:
@@ -97,7 +97,10 @@ int main(int, char**)
|
||||
perror("read(ptm)");
|
||||
continue;
|
||||
}
|
||||
assert(nread != 0);
|
||||
if (nread == 0) {
|
||||
dbgprintf("Terminal: EOF on master pty, closing.\n");
|
||||
break;
|
||||
}
|
||||
for (ssize_t i = 0; i < nread; ++i)
|
||||
terminal.on_char(buffer[i]);
|
||||
terminal.update();
|
||||
|
||||
Reference in New Issue
Block a user