X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fsigsession.cpp;h=dfd0cedb6dc96877871bbbd4774dc1af77c2da2c;hb=adb0a9838d35c42add30f64df4f8df427aed6b89;hp=d89ca61c0d0d44863e180df07da6ac0802713f1c;hpb=bb3030b34e44733036acdfe5b4d4ec0705146831;p=pulseview.git diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index d89ca61c..dfd0cedb 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -83,7 +83,8 @@ SigSession::~SigSession() // Stop and join to the thread stop_capture(); - _dev_inst->release(); + if (_dev_inst) + _dev_inst->release(); // TODO: This should not be necessary _session = NULL; @@ -99,6 +100,9 @@ void SigSession::set_device( { using pv::device::Device; + if (!dev_inst) + return; + // Ensure we are not capturing before setting the device stop_capture(); @@ -630,6 +634,8 @@ void SigSession::data_feed_in(const struct sr_dev_inst *sdi, frame_ended(); break; } + default: + break; } }