]> sigrok.org Git - pulseview.git/blobdiff - pv/data/decoderstack.cpp
Random simplifications, cosmetics/whitespace/consistency fixes.
[pulseview.git] / pv / data / decoderstack.cpp
index f393a1bb84dc06b7034235a88cb110b5879c96a9..8fc3242392bd2642f36a2e093010d8a8c146df38 100644 (file)
@@ -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<mutex> 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;
        }