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

event/SocketEvent: allow Close() without socket

parent 7fc04fd5
...@@ -75,7 +75,6 @@ public: ...@@ -75,7 +75,6 @@ public:
OneServerSocket &operator=(const OneServerSocket &other) = delete; OneServerSocket &operator=(const OneServerSocket &other) = delete;
~OneServerSocket() noexcept { ~OneServerSocket() noexcept {
if (IsDefined())
Close(); Close();
} }
......
...@@ -50,6 +50,9 @@ SocketEvent::Steal() noexcept ...@@ -50,6 +50,9 @@ SocketEvent::Steal() noexcept
void void
SocketEvent::Close() noexcept SocketEvent::Close() noexcept
{ {
if (!fd.IsDefined())
return;
Steal().Close(); 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