1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 12:10:34 +00:00

Adding exception handlings to tracking destructor operations

This commit is contained in:
Javier Arribas 2017-07-25 16:12:10 +02:00
parent 1dda344e46
commit 4642408066
10 changed files with 211 additions and 84 deletions

View File

@ -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 "<<ex.what();
}
}
try{
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_correlator_outs);
volk_gnsssdr_free(d_ca_code);
delete[] d_Prompt_buffer;
multicorrelator_cpu.free();
}catch(const std::exception & ex)
{
LOG(WARNING)<<"Exception in destructor "<<ex.what();
}
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_correlator_outs);
volk_gnsssdr_free(d_ca_code);
delete[] d_Prompt_buffer;
multicorrelator_cpu.free();
}

View File

@ -244,15 +244,28 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::start_tracking()
Galileo_E1_Tcp_Connector_Tracking_cc::~Galileo_E1_Tcp_Connector_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 "<<ex.what();
}
}
try{
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_correlator_outs);
volk_gnsssdr_free(d_ca_code);
delete[] d_Prompt_buffer;
d_tcp_com.close_tcp_connection(d_port);
multicorrelator_cpu.free();
}catch(const std::exception & ex)
{
LOG(WARNING)<<"Exception in destructor "<<ex.what();
}
delete[] d_Prompt_buffer;
volk_gnsssdr_free(d_ca_code);
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_correlator_outs);
d_tcp_com.close_tcp_connection(d_port);
multicorrelator_cpu.free();
}

View File

@ -213,20 +213,31 @@ Galileo_E5a_Dll_Pll_Tracking_cc::Galileo_E5a_Dll_Pll_Tracking_cc(
Galileo_E5a_Dll_Pll_Tracking_cc::~Galileo_E5a_Dll_Pll_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 "<<ex.what();
}
}
try{
delete[] d_codeI;
delete[] d_codeQ;
delete[] d_Prompt_buffer;
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_correlator_outs);
volk_gnsssdr_free(d_Single_Prompt_data);
delete[] d_Prompt_buffer;
multicorrelator_cpu_Q.free();
multicorrelator_cpu_I.free();
}catch(const std::exception & ex)
{
LOG(WARNING)<<"Exception in destructor "<<ex.what();
}
delete[] d_codeI;
delete[] d_codeQ;
delete[] d_Prompt_buffer;
d_dump_file.close();
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_correlator_outs);
volk_gnsssdr_free(d_Single_Prompt_data);
multicorrelator_cpu_Q.free();
multicorrelator_cpu_I.free();
}

View File

@ -299,14 +299,27 @@ void gps_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking()
gps_l1_ca_dll_pll_c_aid_tracking_cc::~gps_l1_ca_dll_pll_c_aid_tracking_cc()
{
d_dump_file.close();
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_correlator_outs);
volk_gnsssdr_free(d_ca_code);
delete[] d_Prompt_buffer;
multicorrelator_cpu.free();
if (d_dump_file.is_open())
{
try
{
d_dump_file.close();
}catch(const std::exception & ex)
{
LOG(WARNING)<<"Exception in destructor "<<ex.what();
}
}
try{
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_correlator_outs);
volk_gnsssdr_free(d_ca_code);
delete[] d_Prompt_buffer;
multicorrelator_cpu.free();
}catch(const std::exception & ex)
{
LOG(WARNING)<<"Exception in destructor "<<ex.what();
}
}

View File

@ -320,15 +320,27 @@ void gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::start_tracking()
gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc::~gps_l1_ca_dll_pll_c_aid_tracking_fpga_sc()
{
d_dump_file.close();
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_ca_code);
volk_gnsssdr_free(d_ca_code_16sc);
volk_gnsssdr_free(d_correlator_outs_16sc);
delete[] d_Prompt_buffer;
multicorrelator_fpga_8sc->free();
if (d_dump_file.is_open())
{
try
{
d_dump_file.close();
}catch(const std::exception & ex)
{
LOG(WARNING)<<"Exception in destructor "<<ex.what();
}
}
try{
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_ca_code);
volk_gnsssdr_free(d_ca_code_16sc);
volk_gnsssdr_free(d_correlator_outs_16sc);
delete[] d_Prompt_buffer;
multicorrelator_fpga_8sc->free();
}catch(const std::exception & ex)
{
LOG(WARNING)<<"Exception in destructor "<<ex.what();
}
}

View File

@ -302,15 +302,28 @@ void gps_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking()
gps_l1_ca_dll_pll_c_aid_tracking_sc::~gps_l1_ca_dll_pll_c_aid_tracking_sc()
{
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 "<<ex.what();
}
}
try{
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_ca_code);
volk_gnsssdr_free(d_ca_code_16sc);
volk_gnsssdr_free(d_correlator_outs_16sc);
delete[] d_Prompt_buffer;
multicorrelator_cpu_16sc.free();
}catch(const std::exception & ex)
{
LOG(WARNING)<<"Exception in destructor "<<ex.what();
}
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_ca_code);
volk_gnsssdr_free(d_ca_code_16sc);
volk_gnsssdr_free(d_correlator_outs_16sc);
delete[] d_Prompt_buffer;
multicorrelator_cpu_16sc.free();
}

View File

@ -267,14 +267,26 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
Gps_L1_Ca_Dll_Pll_Tracking_cc::~Gps_L1_Ca_Dll_Pll_Tracking_cc()
{
d_dump_file.close();
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_correlator_outs);
volk_gnsssdr_free(d_ca_code);
delete[] d_Prompt_buffer;
multicorrelator_cpu.free();
if (d_dump_file.is_open())
{
try
{
d_dump_file.close();
}catch(const std::exception & ex)
{
LOG(WARNING)<<"Exception in destructor "<<ex.what();
}
}
try{
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_correlator_outs);
volk_gnsssdr_free(d_ca_code);
delete[] d_Prompt_buffer;
multicorrelator_cpu.free();
}catch(const std::exception & ex)
{
LOG(WARNING)<<"Exception in destructor "<<ex.what();
}
}

View File

@ -273,14 +273,29 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::start_tracking()
Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::~Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc()
{
d_dump_file.close();
cudaFreeHost(in_gpu);
cudaFreeHost(d_correlator_outs);
cudaFreeHost(d_local_code_shift_chips);
cudaFreeHost(d_ca_code);
multicorrelator_gpu->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 "<<ex.what();
}
}
try{
cudaFreeHost(in_gpu);
cudaFreeHost(d_correlator_outs);
cudaFreeHost(d_local_code_shift_chips);
cudaFreeHost(d_ca_code);
delete[] d_Prompt_buffer;
multicorrelator_gpu->free_cuda();
delete(multicorrelator_gpu);
}catch(const std::exception & ex)
{
LOG(WARNING)<<"Exception in destructor "<<ex.what();
}
}

View File

@ -276,15 +276,27 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking()
Gps_L1_Ca_Tcp_Connector_Tracking_cc::~Gps_L1_Ca_Tcp_Connector_Tracking_cc()
{
d_dump_file.close();
delete[] d_Prompt_buffer;
volk_gnsssdr_free(d_ca_code);
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_correlator_outs);
d_tcp_com.close_tcp_connection(d_port);
multicorrelator_cpu.free();
if (d_dump_file.is_open())
{
try
{
d_dump_file.close();
}catch(const std::exception & ex)
{
LOG(WARNING)<<"Exception in destructor "<<ex.what();
}
}
try{
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_correlator_outs);
volk_gnsssdr_free(d_ca_code);
d_tcp_com.close_tcp_connection(d_port);
delete[] d_Prompt_buffer;
multicorrelator_cpu.free();
}catch(const std::exception & ex)
{
LOG(WARNING)<<"Exception in destructor "<<ex.what();
}
}
int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),

View File

@ -271,14 +271,27 @@ void gps_l2_m_dll_pll_tracking_cc::start_tracking()
gps_l2_m_dll_pll_tracking_cc::~gps_l2_m_dll_pll_tracking_cc()
{
d_dump_file.close();
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_correlator_outs);
volk_gnsssdr_free(d_ca_code);
delete[] d_Prompt_buffer;
multicorrelator_cpu.free();
if (d_dump_file.is_open())
{
try
{
d_dump_file.close();
}catch(const std::exception & ex)
{
LOG(WARNING)<<"Exception in destructor "<<ex.what();
}
}
try{
volk_gnsssdr_free(d_local_code_shift_chips);
volk_gnsssdr_free(d_correlator_outs);
volk_gnsssdr_free(d_ca_code);
delete[] d_Prompt_buffer;
multicorrelator_cpu.free();
}catch(const std::exception & ex)
{
LOG(WARNING)<<"Exception in destructor "<<ex.what();
}
}