diff --git a/protocol/acn/pdu.h b/protocol/acn/pdu.h index 3eb3228..0e541e8 100644 --- a/protocol/acn/pdu.h +++ b/protocol/acn/pdu.h @@ -92,16 +92,16 @@ struct Block } void iStream(Stream s) override { while(s->good()) { - Message p(new T()); - p->iStream(s); - if (s->fail()) // stream failed during pdu read - break; - if (p->stream()->fail()) // pdu buffer failed - continue; - if (!pdu->empty()) // set inheritee - p->setInherit(pdu->back()); - pdu->push_back(p); // add to block - } + auto p = std::make_shared(); + p->iStream(s); + if (s->fail()) // stream failed during pdu read + break; + if (p->stream()->fail()) // pdu buffer failed + continue; + if (!pdu->empty()) // set inheritee + p->setInherit(pdu->back()); + pdu->push_back(p); // add to block + } } void oStream(Stream s) const override { for (const auto & child : *pdu)