MajicDesigns / MD_Parola

Library for modular scrolling LED matrix text displays
GNU Lesser General Public License v2.1
438 stars 135 forks source link

Initialize _suspend and _lastRunTime in MD_PZone constructor #50

Closed thloe1 closed 5 years ago

thloe1 commented 5 years ago

The data members _suspend and _lastRunTime of class MD_PZone are not initialized explicitly, so they will contain random values when the MD_Parola object is created dynamically on the heap.

(In contrast, if an object is created statically, all its data members are automatically initialized with zeros.)

That leads to a problem in MD_PZone::zoneAnimate because this method returns early when _suspend is non-zero. In that case the LED display stays dark.

The change initializes _suspend to false and _lastRunTime to 0 in the MD_PZone constructor.