diff --git a/platformio.ini b/platformio.ini index 07c03129..0e7bf6da 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1072,7 +1072,8 @@ HUB75_build_flags = -D NO_CIE1931 ;; Do not use LED brightness compensation described in CIE 1931. We use FastLED dimming already -D S3_LCD_DIV_NUM=20 ;; Attempt to fix wifi performance issue when panel active with S3 chips -D WLEDMM_SLOWPATH ;; WLEDMM: do not use I2S for driving ws2812 LEDs (HUB75 driver needs I2S#1) -HUB75_lib_deps = https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA.git#aa28e2a9 ;; S3_LCD_DIV_NUM fix +;; HUB75_lib_deps = https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA.git#aa28e2a9 ;; S3_LCD_DIV_NUM fix +HUB75_lib_deps = https://github.com/softhack007/ESP32-HUB75-MatrixPanel-DMA_sh7.git#fix_dangling_pointer ;; S3 bugfix for crash in ~MatrixPanel_I2S_DMA() HUB75_lib_ignore = ESP32 HUB75 LED MATRIX PANEL DMA Display ;; to remove the HUB75 lib dependancy (saves a few bytes) NetDebug_build_flags = diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp index ab124b93..f53cfca6 100644 --- a/wled00/bus_manager.cpp +++ b/wled00/bus_manager.cpp @@ -916,6 +916,7 @@ uint32_t __attribute__((hot)) BusHub75Matrix::getPixelColorRestored(uint16_t pix void BusHub75Matrix::setBrightness(uint8_t b, bool immediate) { _bri = b; + if (!_valid) return; // if (_bri > 238) _bri=238; // not strictly needed. Enable this line if you see glitches at highest brightness. display->setBrightness(_bri); } @@ -967,7 +968,7 @@ void BusHub75Matrix::cleanup() { USER_PRINTLN("HUB75 output ended."); //if (fourScanPanel != nullptr) delete fourScanPanel; // warning: deleting object of polymorphic class type 'VirtualMatrixPanel' which has non-virtual destructor might cause undefined behavior - delete display; + if (display) delete display; display = nullptr; fourScanPanel = nullptr; if (_ledBuffer != nullptr) free(_ledBuffer); _ledBuffer = nullptr;