Raw pointers in `RxCore::readData`
What
Currently, RxCore::readData is expected to return a raw pointer of type RawData*
, which ultimately results in RxCore
implementations that do something like return new RawData(...)
and then relying on the recipient of that data to do the memory clean up, which is not ideal. E.g. see SpecRxCore and the manual checks needed to free up the memory in the data gatherers here.
Proposal
I propose to have RxCore::readData
return std::unique_ptr
, which should be just as efficient as returning a raw pointer.