]> sigrok.org Git - pulseview.git/commitdiff
Open/close devices as needed
authorBert Vermeulen <redacted>
Wed, 24 Apr 2013 19:56:01 +0000 (21:56 +0200)
committerBert Vermeulen <redacted>
Wed, 24 Apr 2013 19:58:28 +0000 (21:58 +0200)
pv/sigsession.cpp

index 354082c7262c351a3fe09423761823e7beab302d..c5a7d494ecf8ed55237b4c440bd3f4497e72c398 100644 (file)
@@ -61,6 +61,10 @@ SigSession::~SigSession()
 
 void SigSession::set_device(struct sr_dev_inst *sdi)
 {
+       if (_sdi)
+               sr_dev_close(_sdi);
+       if (sdi)
+               sr_dev_open(sdi);
        _sdi = sdi;
 }