diff options
| author | Martin Braun <martin.braun@ettus.com> | 2016-05-06 11:02:54 -0700 | 
|---|---|---|
| committer | Martin Braun <martin.braun@ettus.com> | 2016-05-06 11:02:54 -0700 | 
| commit | 30c3a9f0d5ef628855b9cbd0c68b6a92f238e03b (patch) | |
| tree | 3284367df76378c768f296019ebce3e724f86b4b /host/lib/usrp/b200 | |
| parent | 8e1f759a4ce3a5a00c5087daa5fc6dd25ceed74c (diff) | |
| parent | 8426569f5c6ee954c5f0345351bd8239725a8fee (diff) | |
| download | uhd-30c3a9f0d5ef628855b9cbd0c68b6a92f238e03b.tar.gz uhd-30c3a9f0d5ef628855b9cbd0c68b6a92f238e03b.tar.bz2 uhd-30c3a9f0d5ef628855b9cbd0c68b6a92f238e03b.zip  | |
Merge branch 'maint'
Conflicts:
	host/CMakeLists.txt
	host/lib/usrp/b200/b200_impl.cpp
Diffstat (limited to 'host/lib/usrp/b200')
| -rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 12 | 
1 files changed, 8 insertions, 4 deletions
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 0b4eccd5e..78edec31c 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -33,6 +33,7 @@  #include <boost/lexical_cast.hpp>  #include <boost/functional/hash.hpp>  #include <boost/make_shared.hpp> +#include <boost/weak_ptr.hpp>  #include <cstdio>  #include <ctime>  #include <cmath> @@ -730,9 +731,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<property_tree> tree_wptr, fs_path path, bool value, double)  { -    tree->access<bool>(path).set(value); +    property_tree::sptr tree = tree_wptr.lock(); +    if (tree) { +        tree->access<bool>(path).set(value); +    }  }  void b200_impl::setup_radio(const size_t dspno) @@ -796,7 +800,7 @@ void b200_impl::setup_radio(const size_t dspno)      _tree->create<bool>(rx_dsp_path / "rate" / "set").set(false);      _tree->access<double>(rx_dsp_path / "rate" / "value")          .set_coercer(boost::bind(&b200_impl::coerce_rx_samp_rate, this, perif.ddc, dspno, _1)) -        .add_coerced_subscriber(boost::bind(&lambda_set_bool_prop, _tree, rx_dsp_path / "rate" / "set", true, _1)) +        .add_coerced_subscriber(boost::bind(&lambda_set_bool_prop, boost::weak_ptr<property_tree>(_tree), rx_dsp_path / "rate" / "set", true, _1))          .add_coerced_subscriber(boost::bind(&b200_impl::update_rx_samp_rate, this, dspno, _1))      ;      _tree->create<stream_cmd_t>(rx_dsp_path / "stream_cmd") @@ -812,7 +816,7 @@ void b200_impl::setup_radio(const size_t dspno)      _tree->create<bool>(tx_dsp_path / "rate" / "set").set(false);      _tree->access<double>(tx_dsp_path / "rate" / "value")          .set_coercer(boost::bind(&b200_impl::coerce_tx_samp_rate, this, perif.duc, dspno, _1)) -        .add_coerced_subscriber(boost::bind(&lambda_set_bool_prop, _tree, tx_dsp_path / "rate" / "set", true, _1)) +        .add_coerced_subscriber(boost::bind(&lambda_set_bool_prop, boost::weak_ptr<property_tree>(_tree), tx_dsp_path / "rate" / "set", true, _1))          .add_coerced_subscriber(boost::bind(&b200_impl::update_tx_samp_rate, this, dspno, _1))      ;  | 
