diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-06 13:23:39 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-06 13:30:11 +0200 |
commit | 94ddb07e5884675d96a6938069fc3e83698dd898 (patch) | |
tree | be842856035e324b8907db26853dd98eba38fd26 /Services/ProtocolServer | |
parent | f9d3055691c98940bbf43042b1859fbf7740924d (diff) | |
download | serenity-94ddb07e5884675d96a6938069fc3e83698dd898.zip |
LibIPC+Services: Make ClientConnection take socket as NonnullRefPtr
This avoids getting into the awkward situation where the socket is
still part-owned by main() in multi-instance service. Also it just
reads nicer.
Diffstat (limited to 'Services/ProtocolServer')
-rw-r--r-- | Services/ProtocolServer/ClientConnection.cpp | 4 | ||||
-rw-r--r-- | Services/ProtocolServer/ClientConnection.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Services/ProtocolServer/ClientConnection.cpp b/Services/ProtocolServer/ClientConnection.cpp index 21c23d3ec8..2b72ef0025 100644 --- a/Services/ProtocolServer/ClientConnection.cpp +++ b/Services/ProtocolServer/ClientConnection.cpp @@ -35,8 +35,8 @@ namespace ProtocolServer { static HashMap<int, RefPtr<ClientConnection>> s_connections; -ClientConnection::ClientConnection(Core::LocalSocket& socket, int client_id) - : IPC::ClientConnection<ProtocolServerEndpoint>(*this, socket, client_id) +ClientConnection::ClientConnection(NonnullRefPtr<Core::LocalSocket> socket, int client_id) + : IPC::ClientConnection<ProtocolServerEndpoint>(*this, move(socket), client_id) { s_connections.set(client_id, *this); } diff --git a/Services/ProtocolServer/ClientConnection.h b/Services/ProtocolServer/ClientConnection.h index cb0ca45b23..bedba4801f 100644 --- a/Services/ProtocolServer/ClientConnection.h +++ b/Services/ProtocolServer/ClientConnection.h @@ -39,7 +39,7 @@ class ClientConnection final C_OBJECT(ClientConnection); public: - explicit ClientConnection(Core::LocalSocket&, int client_id); + explicit ClientConnection(NonnullRefPtr<Core::LocalSocket>, int client_id); ~ClientConnection() override; virtual void die() override; |