diff --git a/src/event/PollBackend.cxx b/src/event/PollBackend.cxx index 88a6568b0..a505816d0 100644 --- a/src/event/PollBackend.cxx +++ b/src/event/PollBackend.cxx @@ -35,7 +35,9 @@ PollBackend::Add(int fd, unsigned events, void *obj) noexcept e.fd = fd; e.events = events; e.revents = 0; - auto &item = items[fd]; + + auto i = items.emplace(fd, Item{}).first; + auto &item = i->second; item.index = index; item.obj = obj; return true;