]> sigrok.org Git - pulseview.git/blobdiff - pv/devices/inputfile.cpp
Fix #605 by closing current device when another is selected
[pulseview.git] / pv / devices / inputfile.cpp
index e92bf208bf17989039bed7b4dbbbbe277f49093f..13af3db9cd85c791935da6c80bf1a14220d492a0 100644 (file)
@@ -42,10 +42,18 @@ InputFile::InputFile(const std::shared_ptr<sigrok::Context> &context,
                throw QString("Failed to create input");
 }
 
-void InputFile::create() {
+void InputFile::open() {
+       if (session_)
+               close();
+
        session_ = context_->create_session();
 }
 
+void InputFile::close() {
+       if (session_)
+               session_->remove_devices();
+}
+
 void InputFile::start() {
 }