must stop c++ exception in C callbacks

This commit is contained in:
Michael Davidsaver
2019-10-23 10:03:29 -07:00
parent 5301785233
commit 9ff6de6ecf
+5 -1
View File
@@ -144,7 +144,11 @@ struct UDPCollector : public std::enable_shared_from_this<UDPCollector>
static void handle_static(evutil_socket_t fd, short ev, void *raw)
{
(void)fd;
static_cast<UDPCollector*>(raw)->handle(ev);
try {
static_cast<UDPCollector*>(raw)->handle(ev);
}catch(std::exception& e) {
log_printf(logio, PLVL_CRIT, "Ignoring unhandled exception in UDPManager::handle(): %s\n", e.what());
}
}
};