From: Soeren Apel Date: Mon, 11 Apr 2016 06:45:36 +0000 (+0200) Subject: Session: Make sure all data is deleted before changing devices X-Git-Tag: pulseview-0.4.0~309 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4b0d7046aded75445a836d0d8c0f687938398f81;p=pulseview.git Session: Make sure all data is deleted before changing devices --- diff --git a/pv/session.cpp b/pv/session.cpp index ebef90cb..4bc510e9 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -142,7 +142,16 @@ void Session::set_device(shared_ptr device) // Remove all traces signals_.clear(); + cur_logic_segment_.reset(); + + for (auto entry : cur_analog_segments_) { + shared_ptr(entry.first).reset(); + shared_ptr(entry.second).reset(); + } + + logic_data_.reset(); decode_traces_.clear(); + signals_changed(); device_ = std::move(device);