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:
parent
65a1c4a016
commit
7c47fe746c
|
@ -110,6 +110,8 @@ EventLoop::AbandonFD(SocketEvent &event) noexcept
|
|||
#endif
|
||||
assert(event.IsDefined());
|
||||
|
||||
event.unlink();
|
||||
|
||||
return poll_backend.Abandon(event.GetSocket().Get());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue