event/ServerSocket: close only sockets that have been opened

Fixes assertion failure.
This commit is contained in:
Max Kellermann 2013-02-04 11:44:36 +01:00
parent 3b3c9334c8
commit 5692e20fd5

View File

@ -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 &