From: Soeren Apel Date: Sun, 3 Apr 2016 18:33:19 +0000 (+0200) Subject: Session: Improve signal handling during device selection X-Git-Tag: pulseview-0.4.0~326 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=86123e2e4711e67f2246998b7172413199f231f4;p=pulseview.git Session: Improve signal handling during device selection Changing devices now forces an update of the view's signal handling. This will allow clearing the view properly in-between devices. --- diff --git a/pv/session.cpp b/pv/session.cpp index 9fd8fb3e..e2b6dd71 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -138,6 +138,13 @@ void Session::set_device(shared_ptr device) if (device_) device_->close(); + device_.reset(); + + // Remove all traces + signals_.clear(); + decode_traces_.clear(); + signals_changed(); + device_ = std::move(device); device_->open(); device_->session()->add_datafeed_callback([=] @@ -145,8 +152,6 @@ void Session::set_device(shared_ptr device) data_feed_in(device, packet); }); - decode_traces_.clear(); - update_signals(); device_selected(); }