From: Joel Holdsworth Date: Sun, 29 Dec 2013 09:37:43 +0000 (+0100) Subject: Stop capture when device is changed X-Git-Tag: pulseview-0.2.0~176 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=82596f463e2ef38d149421157f9ebd62bad5872d;p=pulseview.git Stop capture when device is changed This resolves bug #223 --- diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index 8cfd86d9..6c9b57f8 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -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)