From 9e8bb7e7d6a8191ff582c40665d1d85ff55328e6 Mon Sep 17 00:00:00 2001 From: Andrew Lynch Date: Wed, 4 May 2016 15:43:38 -0700 Subject: b200: Changed tree sptr in lambda to wptr --- host/lib/usrp/b200/b200_impl.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 327d7760d..3c9fe2e27 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -731,9 +732,12 @@ b200_impl::~b200_impl(void) * setup radio control objects **********************************************************************/ -void lambda_set_bool_prop(property_tree::sptr tree, fs_path path, bool value, double) +void lambda_set_bool_prop(boost::weak_ptr tree_wptr, fs_path path, bool value, double) { - tree->access(path).set(value); + property_tree::sptr tree = tree_wptr.lock(); + if (tree) { + tree->access(path).set(value); + } } void b200_impl::setup_radio(const size_t dspno) -- cgit v1.2.3 From 60ed2ef4212a74911c490f2bb6b91d791844fcfc Mon Sep 17 00:00:00 2001 From: Andrew Lynch Date: Thu, 5 May 2016 09:30:44 -0500 Subject: b200: Changed implicit conversion to explicit conversion for wptr --- host/lib/usrp/b200/b200_impl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 3c9fe2e27..734367af1 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -800,7 +800,7 @@ void b200_impl::setup_radio(const size_t dspno) _tree->create(rx_dsp_path / "rate" / "set").set(false); _tree->access(rx_dsp_path / "rate" / "value") .coerce(boost::bind(&b200_impl::coerce_rx_samp_rate, this, perif.ddc, dspno, _1)) - .subscribe(boost::bind(&lambda_set_bool_prop, _tree, rx_dsp_path / "rate" / "set", true, _1)) + .subscribe(boost::bind(&lambda_set_bool_prop, boost::weak_ptr(_tree), rx_dsp_path / "rate" / "set", true, _1)) .subscribe(boost::bind(&b200_impl::update_rx_samp_rate, this, dspno, _1)) ; _tree->create(rx_dsp_path / "stream_cmd") @@ -817,7 +817,7 @@ void b200_impl::setup_radio(const size_t dspno) _tree->create(tx_dsp_path / "rate" / "set").set(false); _tree->access(tx_dsp_path / "rate" / "value") .coerce(boost::bind(&b200_impl::coerce_tx_samp_rate, this, perif.duc, dspno, _1)) - .subscribe(boost::bind(&lambda_set_bool_prop, _tree, tx_dsp_path / "rate" / "set", true, _1)) + .subscribe(boost::bind(&lambda_set_bool_prop, boost::weak_ptr(_tree), tx_dsp_path / "rate" / "set", true, _1)) .subscribe(boost::bind(&b200_impl::update_tx_samp_rate, this, dspno, _1)) ; -- cgit v1.2.3