diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-20 15:39:15 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-20 15:39:15 +0200 |
commit | d1bacb9885ecaca7d5bd612f2501e9d32abf7411 (patch) | |
tree | 2697b0f614288a76655d728f26bc1d0237523feb /Servers/TelnetServer | |
parent | 50a65604130f9c0aea46799231e88ac956ac018b (diff) | |
download | serenity-d1bacb9885ecaca7d5bd612f2501e9d32abf7411.zip |
LibCore: Convert CNotifier to ObjectPtr
Diffstat (limited to 'Servers/TelnetServer')
-rw-r--r-- | Servers/TelnetServer/Client.cpp | 6 | ||||
-rw-r--r-- | Servers/TelnetServer/Client.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Servers/TelnetServer/Client.cpp b/Servers/TelnetServer/Client.cpp index 485bb23134..6c71ac3231 100644 --- a/Servers/TelnetServer/Client.cpp +++ b/Servers/TelnetServer/Client.cpp @@ -14,10 +14,10 @@ Client::Client(int id, CTCPSocket* socket, int ptm_fd) : m_id(id) , m_socket(socket) , m_ptm_fd(ptm_fd) - , m_ptm_notifier(ptm_fd, CNotifier::Read) + , m_ptm_notifier(CNotifier::create(ptm_fd, CNotifier::Read)) { m_socket->on_ready_to_read = [this] { drain_socket(); }; - m_ptm_notifier.on_ready_to_read = [this] { drain_pty(); }; + m_ptm_notifier->on_ready_to_read = [this] { drain_pty(); }; m_parser.on_command = [this](const Command& command) { handle_command(command); }; m_parser.on_data = [this](const StringView& data) { handle_data(data); }; m_parser.on_error = [this]() { handle_error(); }; @@ -154,7 +154,7 @@ void Client::send_commands(Vector<Command> commands) void Client::quit() { - m_ptm_notifier.set_enabled(false); + m_ptm_notifier->set_enabled(false); close(m_ptm_fd); m_socket->close(); if (on_exit) diff --git a/Servers/TelnetServer/Client.h b/Servers/TelnetServer/Client.h index 83956f8879..60e222cc98 100644 --- a/Servers/TelnetServer/Client.h +++ b/Servers/TelnetServer/Client.h @@ -39,5 +39,5 @@ private: Parser m_parser; // pty resources int m_ptm_fd { -1 }; - CNotifier m_ptm_notifier; + ObjectPtr<CNotifier> m_ptm_notifier; }; |