aboutsummaryrefslogtreecommitdiffstats
path: root/src/Client.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-06 18:02:57 +0100
committerMax Kellermann <max@duempel.org>2014-01-06 18:26:55 +0100
commit793962c5b86cd063036a2d28907b0b33012483e1 (patch)
tree39531d85b0ab2bf480f74c74da788e566991ee25 /src/Client.hxx
parent0d20130d07d69bb8ac4392af8f2ed25e5ea0bbad (diff)
downloadmpd-793962c5b86cd063036a2d28907b0b33012483e1.tar.gz
mpd-793962c5b86cd063036a2d28907b0b33012483e1.tar.xz
mpd-793962c5b86cd063036a2d28907b0b33012483e1.zip
event/SocketMonitor: don't close the socket automatically
Users now have to call Close() explicitly. This simplifies using the class, as most users have automatic socket management already, and Steal() had to be used often.
Diffstat (limited to 'src/Client.hxx')
-rw-r--r--src/Client.hxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Client.hxx b/src/Client.hxx
index c794bf0ee..202cff4da 100644
--- a/src/Client.hxx
+++ b/src/Client.hxx
@@ -82,6 +82,11 @@ public:
Client(EventLoop &loop, Partition &partition,
int fd, int uid, int num);
+ ~Client() {
+ if (FullyBufferedSocket::IsDefined())
+ FullyBufferedSocket::Close();
+ }
+
bool IsConnected() const {
return FullyBufferedSocket::IsDefined();
}