From: Bert Vermeulen Date: Wed, 24 Apr 2013 19:56:01 +0000 (+0200) Subject: Open/close devices as needed X-Git-Tag: pulseview-0.1.0~17 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=884971565598bdd7641f64d9e76dba2cc9b16c01;p=pulseview.git Open/close devices as needed --- diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index 354082c7..c5a7d494 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -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; }