From: Joel Holdsworth Date: Mon, 3 Mar 2014 22:03:57 +0000 (+0000) Subject: Check required probes before starting the decode thread X-Git-Tag: pulseview-0.2.0~32 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=df4c1a0691f6d3a457a475e496186d5a9decc54a;p=pulseview.git Check required probes before starting the decode thread --- diff --git a/pv/data/decoderstack.cpp b/pv/data/decoderstack.cpp index f642b11e..c197e019 100644 --- a/pv/data/decoderstack.cpp +++ b/pv/data/decoderstack.cpp @@ -193,6 +193,14 @@ void DecoderStack::begin_decode() clear(); + // Check that all decoders have the required probes + BOOST_FOREACH(const shared_ptr &dec, _stack) + if (!dec->have_required_probes()) { + _error_message = tr("One or more required probes " + "have not been specified"); + return; + } + // Add classes BOOST_FOREACH (const shared_ptr &dec, _stack) { @@ -320,14 +328,6 @@ void DecoderStack::decode_proc() assert(data); assert(_snapshot); - // Check that all decoders have the required probes - BOOST_FOREACH(const shared_ptr &dec, _stack) - if (!dec->have_required_probes()) { - _error_message = tr("One or more required probes " - "have not been specified"); - return; - } - // Create the session srd_session_new(&session); assert(session);