You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this avoids heap corruption, by double-checking that "use global leds" is not configured, before trying to free ledsrgb[].
It is still a mystery why Segment::_globalLeds == nullptr.
if (name) Serial.printf(" name=%s (%p)", name, name);
517
518
if (data) Serial.printf(" dataLen=%d (%p)", (int)_dataLen, data);
518
519
if (ledsrgb) Serial.printf(" [%sledsrgb %u bytes]", Segment::_globalLeds ? "global ":"",length()*sizeof(CRGB));
520
+
if (strip_uses_global_leds() == true) Serial.println((Segment::_globalLeds != nullptr) ? F(" using global buffer.") : F(", using global buffer but Segment::_globalLeds is NULL!!"));
519
521
Serial.println();
522
+
#ifdef ARDUINO_ARCH_ESP32
523
+
Serial.flush();
524
+
#endif
520
525
}
521
526
#endif
522
527
@@ -525,7 +530,7 @@ typedef struct Segment {
525
530
strip_wait_until_idle("~Segment()");
526
531
#endif
527
532
528
-
if (!Segment::_globalLeds && (ledsrgb != nullptr)) {free(ledsrgb); ledsrgb = nullptr;}
533
+
if ((Segment::_globalLeds == nullptr) && !strip_uses_global_leds() && (ledsrgb != nullptr)) {free(ledsrgb); ledsrgb = nullptr;}// WLEDMM we need "!strip_uses_global_leds()" to avoid crashes (#104)
0 commit comments