aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-02-04 11:44:36 +0100
committerMax Kellermann <max@duempel.org>2013-02-04 11:44:36 +0100
commit5692e20fd50b658537a9c6d8d11e5be35a21fb2e (patch)
tree664b9a50e083493de5f52305154fb2118d8e4535
parent3b3c9334c8216b09a967944e19f604a4acc5ccc3 (diff)
downloadmpd-5692e20fd50b658537a9c6d8d11e5be35a21fb2e.tar.gz
mpd-5692e20fd50b658537a9c6d8d11e5be35a21fb2e.tar.xz
mpd-5692e20fd50b658537a9c6d8d11e5be35a21fb2e.zip
event/ServerSocket: close only sockets that have been opened
Fixes assertion failure.
-rw-r--r--src/event/ServerSocket.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/event/ServerSocket.cxx b/src/event/ServerSocket.cxx
index 8536774dc..119bfe1d7 100644
--- a/src/event/ServerSocket.cxx
+++ b/src/event/ServerSocket.cxx
@@ -98,6 +98,7 @@ public:
bool Open(GError **error_r);
+ using SocketMonitor::IsDefined;
using SocketMonitor::Close;
char *ToString() const;
@@ -286,7 +287,8 @@ void
ServerSocket::Close()
{
for (auto &i : sockets)
- i.Close();
+ if (i.IsDefined())
+ i.Close();
}
OneServerSocket &