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
This commit is contained in:
@@ -110,6 +110,8 @@ EventLoop::AbandonFD(SocketEvent &event) noexcept
|
||||
#endif
|
||||
assert(event.IsDefined());
|
||||
|
||||
event.unlink();
|
||||
|
||||
return poll_backend.Abandon(event.GetSocket().Get());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user