1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-30 02:44:50 +00:00

Catch exceptions when stopping the rtcm server

Defect detected by Coverity scan
This commit is contained in:
Carles Fernandez 2017-01-14 15:43:34 +01:00
parent 8eb01075f4
commit 3e18d54a74
2 changed files with 24 additions and 2 deletions

View File

@ -128,9 +128,20 @@ Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_server, bool fla
Rtcm_Printer::~Rtcm_Printer() Rtcm_Printer::~Rtcm_Printer()
{ {
if(rtcm->is_server_running()) if(rtcm->is_server_running())
{
try
{ {
rtcm->stop_server(); rtcm->stop_server();
} }
catch( boost::exception & e )
{
LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e);
}
catch(std::exception const& ex)
{
LOG(WARNING) << "STD exception: " << ex.what();
}
}
if (rtcm_file_descriptor.is_open()) if (rtcm_file_descriptor.is_open())
{ {
long pos; long pos;

View File

@ -60,9 +60,20 @@ Rtcm::Rtcm(unsigned short port)
Rtcm::~Rtcm() Rtcm::~Rtcm()
{ {
if(server_is_running) if(server_is_running)
{
try
{ {
stop_server(); stop_server();
} }
catch( boost::exception & e )
{
LOG(WARNING) << "Boost exception: " << boost::diagnostic_information(e);
}
catch(std::exception const& ex)
{
LOG(WARNING) << "STD exception: " << ex.what();
}
}
} }