Suppress exceptions in destructors
This commit is contained in:
parent
980f0e6a9b
commit
0bf58e3bf8
|
@ -6,9 +6,12 @@
|
|||
|
||||
#include "carla/client/detail/Episode.h"
|
||||
|
||||
#include "carla/Logging.h"
|
||||
#include "carla/client/detail/Client.h"
|
||||
#include "carla/sensor/Deserializer.h"
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace carla {
|
||||
namespace client {
|
||||
namespace detail {
|
||||
|
@ -25,7 +28,11 @@ namespace detail {
|
|||
_state(std::make_shared<EpisodeState>()) {}
|
||||
|
||||
Episode::~Episode() {
|
||||
_client.UnSubscribeFromStream(_description.token);
|
||||
try {
|
||||
_client.UnSubscribeFromStream(_description.token);
|
||||
} catch (const std::exception &e) {
|
||||
log_error("exception trying to disconnect from episode:", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
void Episode::Listen() {
|
||||
|
|
|
@ -31,7 +31,11 @@ namespace detail {
|
|||
// session remaining since at this point the io_service should be already
|
||||
// stopped.
|
||||
for (auto &pair : _stream_map) {
|
||||
pair.second->ClearSessions();
|
||||
try {
|
||||
pair.second->ClearSessions();
|
||||
} catch (const std::exception &e) {
|
||||
log_error("failed to clear sessions:", e.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue