]> sigrok.org Git - pulseview.git/commitdiff
Session: Make sure all data is deleted before changing devices
authorSoeren Apel <redacted>
Mon, 11 Apr 2016 06:45:36 +0000 (08:45 +0200)
committerSoeren Apel <redacted>
Mon, 11 Apr 2016 06:45:36 +0000 (08:45 +0200)
pv/session.cpp

index ebef90cbb6590fb9961fad97f73047e56e8acc79..4bc510e9fa538d5eb3a848fde39ea4604520512d 100644 (file)
@@ -142,7 +142,16 @@ void Session::set_device(shared_ptr<devices::Device> device)
 
        // Remove all traces
        signals_.clear();
+       cur_logic_segment_.reset();
+
+       for (auto entry : cur_analog_segments_) {
+               shared_ptr<sigrok::Channel>(entry.first).reset();
+               shared_ptr<data::AnalogSegment>(entry.second).reset();
+       }
+
+       logic_data_.reset();
        decode_traces_.clear();
+
        signals_changed();
 
        device_ = std::move(device);