From 4642408066a0aaeccaa156c8e652c0caff84ee4e Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Tue, 25 Jul 2017 16:12:10 +0200 Subject: [PATCH] Adding exception handlings to tracking destructor operations --- .../galileo_e1_dll_pll_veml_tracking_cc.cc | 27 ++++++++++---- .../galileo_e1_tcp_connector_tracking_cc.cc | 29 +++++++++++---- .../galileo_e5a_dll_pll_tracking_cc.cc | 37 ++++++++++++------- .../gps_l1_ca_dll_pll_c_aid_tracking_cc.cc | 27 ++++++++++---- ...ps_l1_ca_dll_pll_c_aid_tracking_fpga_sc.cc | 30 ++++++++++----- .../gps_l1_ca_dll_pll_c_aid_tracking_sc.cc | 29 +++++++++++---- .../gps_l1_ca_dll_pll_tracking_cc.cc | 28 ++++++++++---- .../gps_l1_ca_dll_pll_tracking_gpu_cc.cc | 31 ++++++++++++---- .../gps_l1_ca_tcp_connector_tracking_cc.cc | 30 ++++++++++----- .../gps_l2_m_dll_pll_tracking_cc.cc | 27 ++++++++++---- 10 files changed, 211 insertions(+), 84 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.cc index a16eaaa0a..c611bbb9c 100755 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_dll_pll_veml_tracking_cc.cc @@ -251,14 +251,27 @@ void galileo_e1_dll_pll_veml_tracking_cc::start_tracking() galileo_e1_dll_pll_veml_tracking_cc::~galileo_e1_dll_pll_veml_tracking_cc() { - d_dump_file.close(); + if (d_dump_file.is_open()) + { + try + { + d_dump_file.close(); + }catch(const std::exception & ex) + { + LOG(WARNING)<<"Exception in destructor "<free(); + if (d_dump_file.is_open()) + { + try + { + d_dump_file.close(); + }catch(const std::exception & ex) + { + LOG(WARNING)<<"Exception in destructor "<free(); + }catch(const std::exception & ex) + { + LOG(WARNING)<<"Exception in destructor "<free_cuda(); - delete[] d_Prompt_buffer; - delete(multicorrelator_gpu); + if (d_dump_file.is_open()) + { + try + { + d_dump_file.close(); + }catch(const std::exception & ex) + { + LOG(WARNING)<<"Exception in destructor "<free_cuda(); + delete(multicorrelator_gpu); + }catch(const std::exception & ex) + { + LOG(WARNING)<<"Exception in destructor "<