X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsession.cpp;h=542b88b798188696eabc216947065bf5f43c06ce;hp=2cdc25f83ed0ee3c718896da9d8df98d13f34876;hb=c6412b47eb1f5529fd76247caa7de09b6c9693d5;hpb=30d6f09f5eec0fb18d5c87347b5de6124a56a63c diff --git a/pv/session.cpp b/pv/session.cpp index 2cdc25f8..542b88b7 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -306,8 +306,15 @@ void Session::update_signals(shared_ptr device) assert(device); assert(capture_state_ == Stopped); + const shared_ptr sr_dev = device->device(); + if (!sr_dev) { + signals_.clear(); + logic_data_.reset(); + return; + } + // Detect what data types we will receive - auto channels = device->device()->channels(); + auto channels = sr_dev->channels(); unsigned int logic_channel_count = std::count_if( channels.begin(), channels.end(), [] (shared_ptr channel) { @@ -334,7 +341,7 @@ void Session::update_signals(shared_ptr device) unordered_set< shared_ptr > prev_sigs(signals_); signals_.clear(); - for (auto channel : device->device()->channels()) { + for (auto channel : sr_dev->channels()) { shared_ptr signal; // Find the channel in the old signals