diff options
author | Max Kellermann <max@duempel.org> | 2013-02-04 11:44:36 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-02-04 11:44:36 +0100 |
commit | 5692e20fd50b658537a9c6d8d11e5be35a21fb2e (patch) | |
tree | 664b9a50e083493de5f52305154fb2118d8e4535 | |
parent | 3b3c9334c8216b09a967944e19f604a4acc5ccc3 (diff) | |
download | mpd-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.cxx | 4 |
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 & |