event/SocketEvent: allow Close() without socket
This commit is contained in:
parent
7fc04fd5cd
commit
9f013f7de4
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue