From 999d5e8af7364b89b01c90bbc3d4008474173a3f Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Wed, 28 Apr 2021 15:39:07 +0100 Subject: [PATCH] Use correct delete operator --- .../channeltx/mod802.15.4/ieee_802_15_4_modsource.cpp | 5 ++--- plugins/channeltx/moddatv/dvb-s/dvb-s.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/plugins/channeltx/mod802.15.4/ieee_802_15_4_modsource.cpp b/plugins/channeltx/mod802.15.4/ieee_802_15_4_modsource.cpp index 3a1b9a67a..7509d2396 100644 --- a/plugins/channeltx/mod802.15.4/ieee_802_15_4_modsource.cpp +++ b/plugins/channeltx/mod802.15.4/ieee_802_15_4_modsource.cpp @@ -53,7 +53,7 @@ IEEE_802_15_4_ModSource::IEEE_802_15_4_ModSource() : IEEE_802_15_4_ModSource::~IEEE_802_15_4_ModSource() { - delete m_sinLUT; + delete[] m_sinLUT; } void IEEE_802_15_4_ModSource::pull(SampleVector::iterator begin, unsigned int nbSamples) @@ -406,8 +406,7 @@ void IEEE_802_15_4_ModSource::createHalfSine(int sampleRate, int chipRate) int samplesPerChip = sampleRate / chipRate; double tc = 1.0 / chipRate; - if (m_sinLUT) - delete m_sinLUT; + delete[] m_sinLUT; m_sinLUT = new double[2*samplesPerChip]; for (int i = 0; i < 2*samplesPerChip; i++) { diff --git a/plugins/channeltx/moddatv/dvb-s/dvb-s.cpp b/plugins/channeltx/moddatv/dvb-s/dvb-s.cpp index 03d6fac2b..c3307e831 100644 --- a/plugins/channeltx/moddatv/dvb-s/dvb-s.cpp +++ b/plugins/channeltx/moddatv/dvb-s/dvb-s.cpp @@ -47,13 +47,13 @@ DVBS::~DVBS() { // Free interleaver FIFO memory for (int i = 1; i < interleaveDepth; i++) - delete m_interleaveFIFO[i]; - delete m_interleaveIdx; - delete m_interleaveLen; - delete m_interleaveFIFO; + delete[] m_interleaveFIFO[i]; + delete[] m_interleaveIdx; + delete[] m_interleaveLen; + delete[] m_interleaveFIFO; // Free packet buffer - delete m_packet; + delete[] m_packet; } // Scramble input packet (except for sync bytes) with psuedo random binary sequence