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) {
std::string eventString = (ev.event + ">>" + ev.data).substr(0, 1022) + "\n";
for (auto& fd : m_dAcceptedSocketFDs) {
write(fd.first, eventString.c_str(), eventString.length());
try {
write(fd.first, eventString.c_str(), eventString.length());
} catch(...) {}
}
}