1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-08 19:23:07 +00:00

Avoid throwing in the destructor

This commit is contained in:
Carles Fernandez
2018-05-19 22:42:08 +02:00
parent 7d4fe83fb6
commit fc18408f11

View File

@@ -36,6 +36,7 @@
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "GPS_L2C.h" #include "GPS_L2C.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <exception>
#include <iostream> // for cout, endl #include <iostream> // for cout, endl
#ifdef __APPLE__ #ifdef __APPLE__
@@ -121,9 +122,16 @@ Ad9361FpgaSignalSource::~Ad9361FpgaSignalSource()
//if (rx0_q) { iio_channel_disable(rx0_q); } //if (rx0_q) { iio_channel_disable(rx0_q); }
if (enable_dds_lo_) if (enable_dds_lo_)
{
try
{ {
ad9361_disable_lo_local(); ad9361_disable_lo_local();
} }
catch (const std::exception& e)
{
LOW(WARNING) << "Problem closing the Ad9361FpgaSignalSource: " << e.what();
}
}
// std::cout<<"* AD9361 Destroying context\n"; // std::cout<<"* AD9361 Destroying context\n";
//if (ctx) { iio_context_destroy(ctx); } //if (ctx) { iio_context_destroy(ctx); }