From bcd64b9b7ae8187a9519c374e2552f6a00904251 Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Thu, 2 Mar 2017 23:07:53 +0100 Subject: [PATCH] Fix #829 by not throwing when device can't be used --- pv/session.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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(); } -- 2.30.2