Commit 9f013f7d authored by Max Kellermann's avatar Max Kellermann

event/SocketEvent: allow Close() without socket

parent 7fc04fd5
......@@ -75,8 +75,7 @@ public:
OneServerSocket &operator=(const OneServerSocket &other) = delete;
~OneServerSocket() noexcept {
if (IsDefined())
Close();
Close();
}
[[nodiscard]] unsigned GetSerial() const noexcept {
......
......@@ -50,6 +50,9 @@ SocketEvent::Steal() noexcept
void
SocketEvent::Close() noexcept
{
if (!fd.IsDefined())
return;
Steal().Close();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment