From 32a02a5f0f1b19a8a1215059d3d3fdc0b966b21b Mon Sep 17 00:00:00 2001 From: Emil Muratov Date: Tue, 17 Aug 2021 00:39:19 +0300 Subject: [PATCH] Add proper destructor to the class Closes #165 --- ESP32-HUB75-MatrixPanel-I2S-DMA.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ESP32-HUB75-MatrixPanel-I2S-DMA.h b/ESP32-HUB75-MatrixPanel-I2S-DMA.h index a2caeca..ae55622 100644 --- a/ESP32-HUB75-MatrixPanel-I2S-DMA.h +++ b/ESP32-HUB75-MatrixPanel-I2S-DMA.h @@ -397,6 +397,17 @@ class MatrixPanel_I2S_DMA { } + // Obj destructor + ~MatrixPanel_I2S_DMA(){ + stopDMAoutput(); + + delete dmadesc_a; + + if (m_cfg.double_buff) + delete dmadesc_b; + } + + /* * overload for compatibility */