aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorTrung Tran <trung.tran@ettus.com>2018-10-24 11:01:31 -0700
committerMartin Braun <martin.braun@ettus.com>2018-10-24 15:21:21 -0700
commit12dd0939fcc877e4f30c045ead6b2d8fc2f63772 (patch)
treeeee2622fb105c7ad2447b420754fc7bc9581a70e /host/lib
parent2801dc0f4e3cf7dd3e9a4bc60a7a44f391a6a4a1 (diff)
downloaduhd-12dd0939fcc877e4f30c045ead6b2d8fc2f63772.tar.gz
uhd-12dd0939fcc877e4f30c045ead6b2d8fc2f63772.tar.bz2
uhd-12dd0939fcc877e4f30c045ead6b2d8fc2f63772.zip
block_ctrl_base: add UHD_SAFE_CALL to destructor
This will stop the exception throw during destructor of E310 where new FPGA image(idle image) is load.
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/rfnoc/block_ctrl_base.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/host/lib/rfnoc/block_ctrl_base.cpp b/host/lib/rfnoc/block_ctrl_base.cpp
index 277aedf80..fada105de 100644
--- a/host/lib/rfnoc/block_ctrl_base.cpp
+++ b/host/lib/rfnoc/block_ctrl_base.cpp
@@ -21,7 +21,7 @@
#include <boost/bind.hpp>
#include <chrono>
#include <thread>
-
+#include <uhd/utils/safe_call.hpp>
using namespace uhd;
using namespace uhd::rfnoc;
using std::string;
@@ -143,18 +143,20 @@ block_ctrl_base::block_ctrl_base(
block_ctrl_base::~block_ctrl_base()
{
- if (get_ctrl_ports().size() > 0) {
- // Notify the data-path gatekeeper in noc_shell that we are done
- // with this block. This operation disconnects the noc_block
- // data-path from noc_shell which dumps all input and output
- // packets that are in flight, for now and until the setting is
- // disabled. This prevents long-running blocks without a tear-down
- // mechanism to gracefully flush.
- const size_t port = get_ctrl_ports().front();
- sr_write(SR_CLEAR_TX_FC, 0x2, port); // Disconnect TX data-path
- sr_write(SR_CLEAR_RX_FC, 0x2, port); // Disconnect RX data-path
- }
- _tree->remove(_root_path);
+ UHD_SAFE_CALL(
+ if (get_ctrl_ports().size() > 0) {
+ // Notify the data-path gatekeeper in noc_shell that we are done
+ // with this block. This operation disconnects the noc_block
+ // data-path from noc_shell which dumps all input and output
+ // packets that are in flight, for now and until the setting is
+ // disabled. This prevents long-running blocks without a tear-down
+ // mechanism to gracefully flush.
+ const size_t port = get_ctrl_ports().front();
+ sr_write(SR_CLEAR_TX_FC, 0x2, port); // Disconnect TX data-path
+ sr_write(SR_CLEAR_RX_FC, 0x2, port); // Disconnect RX data-path
+ }
+ _tree->remove(_root_path);
+ )
}
void block_ctrl_base::_init_port_defs(