event/ServerSocket: close only sockets that have been opened
Fixes assertion failure.
This commit is contained in:
parent
3b3c9334c8
commit
5692e20fd5
@ -98,6 +98,7 @@ public:
|
|||||||
|
|
||||||
bool Open(GError **error_r);
|
bool Open(GError **error_r);
|
||||||
|
|
||||||
|
using SocketMonitor::IsDefined;
|
||||||
using SocketMonitor::Close;
|
using SocketMonitor::Close;
|
||||||
|
|
||||||
char *ToString() const;
|
char *ToString() const;
|
||||||
@ -286,7 +287,8 @@ void
|
|||||||
ServerSocket::Close()
|
ServerSocket::Close()
|
||||||
{
|
{
|
||||||
for (auto &i : sockets)
|
for (auto &i : sockets)
|
||||||
i.Close();
|
if (i.IsDefined())
|
||||||
|
i.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
OneServerSocket &
|
OneServerSocket &
|
||||||
|
Loading…
Reference in New Issue
Block a user