Commit 7c47fe74 authored by Max Kellermann's avatar Max Kellermann

event/Loop: AbandonFD() unlinks the SocketEvent

Fixes use-after-free bugs causing assertion failures at shutdown, because all "abandoned" SocketEvents are still in the linked list. Closes https://github.com/MusicPlayerDaemon/MPD/issues/986 Closes https://github.com/MusicPlayerDaemon/MPD/issues/987
parent 65a1c4a0
......@@ -110,6 +110,8 @@ EventLoop::AbandonFD(SocketEvent &event) noexcept
#endif
assert(event.IsDefined());
event.unlink();
return poll_backend.Abandon(event.GetSocket().Get());
}
......
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