From: Soeren Apel Date: Thu, 2 Mar 2017 22:07:53 +0000 (+0100) Subject: Fix #829 by not throwing when device can't be used X-Git-Tag: pulseview-0.4.0~174 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=bcd64b9b7ae8187a9519c374e2552f6a00904251;p=pulseview.git Fix #829 by not throwing when device can't be used --- diff --git a/pv/session.cpp b/pv/session.cpp index c9a569f7..31cbb73c 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -415,16 +415,17 @@ void Session::set_device(shared_ptr device) device_->open(); } catch (const QString &e) { device_.reset(); - device_changed(); - throw; } - device_->session()->add_datafeed_callback([=] - (shared_ptr device, shared_ptr packet) { - data_feed_in(device, packet); - }); + if (device_) { + device_->session()->add_datafeed_callback([=] + (shared_ptr device, shared_ptr packet) { + data_feed_in(device, packet); + }); + + update_signals(); + } - update_signals(); device_changed(); }