From 6f966ca51dc0f784236850a7cfbcfc72d328836a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 20 Mar 2019 02:46:36 +0100 Subject: [PATCH] Kernel: Accepting sockets don't need to retain the client sockets. This is all taken care of by the respective FileDescriptors. Before this patch, we were leaking every single socket, not great! --- Kernel/LocalSocket.h | 1 - Kernel/Socket.cpp | 1 - Kernel/Socket.h | 1 - 3 files changed, 3 deletions(-) diff --git a/Kernel/LocalSocket.h b/Kernel/LocalSocket.h index 4d65391d100..1b56b0a33be 100644 --- a/Kernel/LocalSocket.h +++ b/Kernel/LocalSocket.h @@ -27,7 +27,6 @@ private: virtual bool is_local() const override { return true; } RetainPtr m_file; - RetainPtr m_peer; bool m_bound { false }; int m_accepted_fds_open { 0 }; diff --git a/Kernel/Socket.cpp b/Kernel/Socket.cpp index e6aeecc7aab..e6e26114b68 100644 --- a/Kernel/Socket.cpp +++ b/Kernel/Socket.cpp @@ -49,7 +49,6 @@ RetainPtr Socket::accept() auto client = m_pending.take_first(); ASSERT(!client->is_connected()); client->m_connected = true; - m_clients.append(client.copy_ref()); return client; } diff --git a/Kernel/Socket.h b/Kernel/Socket.h index 2b8866a3f52..683ff538589 100644 --- a/Kernel/Socket.h +++ b/Kernel/Socket.h @@ -74,7 +74,6 @@ private: timeval m_send_deadline { 0, 0 }; Vector> m_pending; - Vector> m_clients; }; class SocketHandle {