summaryrefslogtreecommitdiff
path: root/Kernel/Process.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-11-06 16:52:54 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-11-06 16:52:54 +0100
commit2f16e31afcf065cbe9c903889c0bb74f0bb2adb0 (patch)
tree652ed3e30bef8d410e4b06ee65c280d856df7c66 /Kernel/Process.h
parent083c5f8b89ff7322770e53c640202b630864ba0d (diff)
downloadserenity-2f16e31afcf065cbe9c903889c0bb74f0bb2adb0.zip
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.
Diffstat (limited to 'Kernel/Process.h')
-rw-r--r--Kernel/Process.h2
1 files changed, 1 insertions, 1 deletions
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<Custody> m_executable;
RefPtr<Custody> m_cwd;
- TTY* m_tty { nullptr };
+ RefPtr<TTY> m_tty;
Region* region_from_range(const Range&);
Region* region_containing(const Range&);