event/SocketEvent: allow Close() without socket
This commit is contained in:
@@ -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
|
|||||||
void
|
void
|
||||||
SocketEvent::Close() noexcept
|
SocketEvent::Close() noexcept
|
||||||
{
|
{
|
||||||
|
if (!fd.IsDefined())
|
||||||
|
return;
|
||||||
|
|
||||||
Steal().Close();
|
Steal().Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user