case State::PAUSED: {
// Stop IOService.
if (!io_service_->stopped()) {
- io_service_->poll();
+ try {
+ io_service_->poll();
+ } catch (...) {
+ // Catch all exceptions.
+ // Logging is not available.
+ }
io_service_->stop();
}
case State::STOPPED: {
// Stop IOService.
if (!io_service_->stopped()) {
- io_service_->poll();
+ try {
+ io_service_->poll();
+ } catch (...) {
+ // Catch all exceptions.
+ // Logging is not available.
+ }
io_service_->stop();
}
}
}
- // Run the IOService.
- io_service_->run();
+ try {
+ // Run the IOService.
+ io_service_->run();
+ } catch (...) {
+ // Catch all exceptions.
+ // Logging is not available.
+ }
{
std::unique_lock<std::mutex> lck(mutex_);
}
io_signal_set_.reset();
- getIOService()->poll();
+ try {
+ getIOService()->poll();
+ } catch (...) {
+ // Don't want to throw exceptions from the destructor. The process
+ // is shutting down anyway.
+ ;
+ }
}
std::string