event/SocketEvent: check/clear scheduled_flags in Close()

Fixes regression by commit 521e573be9
This commit is contained in:
Max Kellermann 2020-10-14 21:08:09 +02:00
parent 1c079e554b
commit 55db7105c5

View File

@ -53,7 +53,8 @@ SocketEvent::Close() noexcept
if (!fd.IsDefined())
return;
loop.AbandonFD(fd.Get());
if (std::exchange(scheduled_flags, 0) != 0)
loop.AbandonFD(fd.Get());
fd.Close();
}