aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/device.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-11-28 12:17:39 -0800
committerMartin Braun <martin.braun@ettus.com>2016-11-28 12:17:39 -0800
commitfc54c27b48028c9c8139175d40b4b061800f32e3 (patch)
treebd4ef22159d5bd65458e50fb3e5050a9b63559bf /host/lib/device.cpp
parent9fe731cc371efee7f0051186697e611571c5b41b (diff)
parent33c0b32db12ee154b1090360fbf76634590fdd3e (diff)
downloaduhd-fc54c27b48028c9c8139175d40b4b061800f32e3.tar.gz
uhd-fc54c27b48028c9c8139175d40b4b061800f32e3.tar.bz2
uhd-fc54c27b48028c9c8139175d40b4b061800f32e3.zip
Merge branch 'maint'
Diffstat (limited to 'host/lib/device.cpp')
-rw-r--r--host/lib/device.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/host/lib/device.cpp b/host/lib/device.cpp
index ff4bbc212..c75ecad77 100644
--- a/host/lib/device.cpp
+++ b/host/lib/device.cpp
@@ -162,13 +162,11 @@ device::sptr device::make(const device_addr_t &hint, device_filter_t filter, siz
static uhd::dict<size_t, boost::weak_ptr<device> > hash_to_device;
//try to find an existing device
- try{
- UHD_ASSERT_THROW(hash_to_device.has_key(dev_hash));
- UHD_ASSERT_THROW(not hash_to_device[dev_hash].expired());
+ if (hash_to_device.has_key(dev_hash) and not hash_to_device[dev_hash].expired()){
return hash_to_device[dev_hash].lock();
}
- //create and register a new device
- catch(const uhd::assertion_error &){
+ else {
+ //create and register a new device
device::sptr dev = maker(dev_addr);
hash_to_device[dev_hash] = dev;
return dev;