X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Fdecoderstack.cpp;h=561e229dda8ec647f13238978b0c212cac3af480;hp=f393a1bb84dc06b7034235a88cb110b5879c96a9;hb=489953884c0d7692fa20748314751e114ae54cf2;hpb=6f925ba9d6faf1077b73c5a5808259576081716a diff --git a/pv/data/decoderstack.cpp b/pv/data/decoderstack.cpp index f393a1bb..561e229d 100644 --- a/pv/data/decoderstack.cpp +++ b/pv/data/decoderstack.cpp @@ -25,10 +25,10 @@ #include "decoderstack.hpp" +#include +#include #include #include -#include -#include #include #include @@ -40,8 +40,6 @@ using std::make_pair; using std::max; using std::min; using std::list; -using std::map; -using std::pair; using std::shared_ptr; using std::make_shared; using std::vector; @@ -317,8 +315,10 @@ void DecoderStack::decode_data( if (srd_session_send(session, i, chunk_end, chunk, (chunk_end - i) * unit_size, unit_size) != SRD_OK) { error_message_ = tr("Decoder reported an error"); + delete[] chunk; break; } + delete[] chunk; { lock_guard lock(output_mutex_); @@ -416,14 +416,14 @@ void DecoderStack::annotation_callback(srd_proto_data *pdata, void *decoder) row_iter = d->rows_.find((*r).second); else { // Failing that, use the decoder as a key - row_iter = d->rows_.find(Row(decc)); + row_iter = d->rows_.find(Row(decc)); } assert(row_iter != d->rows_.end()); if (row_iter == d->rows_.end()) { qDebug() << "Unexpected annotation: decoder = " << decc << ", format = " << a.format(); - assert(0); + assert(false); return; }