Fix broken pipe crash when event listener terminates (#2339)

This commit is contained in:
maqrrr 2023-05-21 08:38:18 -04:00 committed by GitHub
parent 5627b70981
commit 9f8c5cb63c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -108,7 +108,9 @@ void CEventManager::flushEvents() {
for (auto& ev : m_dQueuedEvents) { for (auto& ev : m_dQueuedEvents) {
std::string eventString = (ev.event + ">>" + ev.data).substr(0, 1022) + "\n"; std::string eventString = (ev.event + ">>" + ev.data).substr(0, 1022) + "\n";
for (auto& fd : m_dAcceptedSocketFDs) { for (auto& fd : m_dAcceptedSocketFDs) {
try {
write(fd.first, eventString.c_str(), eventString.length()); write(fd.first, eventString.c_str(), eventString.length());
} catch(...) {}
} }
} }