]> sigrok.org Git - pulseview.git/commitdiff
Stop capture when device is changed
authorJoel Holdsworth <redacted>
Sun, 29 Dec 2013 09:37:43 +0000 (10:37 +0100)
committerJoel Holdsworth <redacted>
Sun, 29 Dec 2013 09:37:43 +0000 (10:37 +0100)
This resolves bug #223

pv/sigsession.cpp

index 8cfd86d9a9782fc340c6fdebf9103d8edba96c3c..6c9b57f84ac1e9492d321b606144643dc1acad3e 100644 (file)
@@ -85,6 +85,9 @@ struct sr_dev_inst* SigSession::get_device() const
 
 void SigSession::set_device(struct sr_dev_inst *sdi)
 {
+       // Ensure we are not capturing before setting the device
+       stop_capture();
+
        if (_sdi)
                _device_manager.release_device(_sdi);
        if (sdi)