From 2f16e31afcf065cbe9c903889c0bb74f0bb2adb0 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 6 Nov 2019 16:52:54 +0100 Subject: [PATCH] Kernel: A running process should keep its TTY alive It's not safe to use a raw pointer for Process::m_tty. A pseudoterminal pair will disappear when file descriptors are closed, and we'd end up looking dangly. Just use a RefPtr. --- Kernel/Process.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Process.h b/Kernel/Process.h index 63470bce86..236579e9c2 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -348,7 +348,7 @@ private: RefPtr m_executable; RefPtr m_cwd; - TTY* m_tty { nullptr }; + RefPtr m_tty; Region* region_from_range(const Range&); Region* region_containing(const Range&);