summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-08-04 22:00:42 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-08-04 22:02:25 +0200
commit948c2657d6f04ee38dfae57b4e31e0c577927731 (patch)
treec31a913c5f2bd11774e731dab9800839055c2f41 /Libraries
parente58b7343632f8b5bb0e03a436d9db5872084d236 (diff)
downloadserenity-948c2657d6f04ee38dfae57b4e31e0c577927731.zip
CSocket: Close the underlying socket on destruction
Otherwise we leak the file descriptor.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibCore/CSocket.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Libraries/LibCore/CSocket.cpp b/Libraries/LibCore/CSocket.cpp
index ca83b97be5..f9bfd1b3bf 100644
--- a/Libraries/LibCore/CSocket.cpp
+++ b/Libraries/LibCore/CSocket.cpp
@@ -18,6 +18,7 @@ CSocket::CSocket(Type type, CObject* parent)
CSocket::~CSocket()
{
+ close();
}
bool CSocket::connect(const String& hostname, int port)