diff --git a/Kernel/TTY/SlavePTY.cpp b/Kernel/TTY/SlavePTY.cpp index e2b0921d514..7d8550df3b8 100644 --- a/Kernel/TTY/SlavePTY.cpp +++ b/Kernel/TTY/SlavePTY.cpp @@ -35,9 +35,9 @@ bool SlavePTY::unref() const return did_hit_zero; } -SlavePTY::SlavePTY(MasterPTY& master, unsigned index) +SlavePTY::SlavePTY(NonnullRefPtr master, unsigned index) : TTY(201, index) - , m_master(master) + , m_master(move(master)) , m_index(index) { auto& process = Process::current(); diff --git a/Kernel/TTY/SlavePTY.h b/Kernel/TTY/SlavePTY.h index 585c2f11a2b..7161fc9082b 100644 --- a/Kernel/TTY/SlavePTY.h +++ b/Kernel/TTY/SlavePTY.h @@ -42,9 +42,9 @@ private: virtual ErrorOr close() override; friend class MasterPTY; - SlavePTY(MasterPTY&, unsigned index); + SlavePTY(NonnullRefPtr, unsigned index); - LockRefPtr m_master; + NonnullRefPtr const m_master; time_t m_time_of_last_write { 0 }; unsigned m_index { 0 };