Use unique_ptr for baseband_buffer.

This commit is contained in:
Jared Boone 2016-02-23 20:21:32 -08:00
parent 3493b7d1b7
commit 6101ca36cd

View File

@ -85,7 +85,7 @@ void BasebandThread::run() {
baseband_sgpio.init(); baseband_sgpio.init();
baseband::dma::init(); baseband::dma::init();
const auto baseband_buffer = new std::array<baseband::sample_t, 8192>(); const auto baseband_buffer = std::make_unique<std::array<baseband::sample_t, 8192>>();
baseband::dma::configure( baseband::dma::configure(
baseband_buffer->data(), baseband_buffer->data(),
direction() direction()
@ -119,8 +119,6 @@ void BasebandThread::run() {
); );
} }
} }
delete baseband_buffer;
} }
BasebandProcessor* BasebandThread::create_processor(const int32_t mode) { BasebandProcessor* BasebandThread::create_processor(const int32_t mode) {