Closed bloodhoundmichael closed 11 months ago
The destructor of SimpleFSM:
SimpleFSM::~SimpleFSM() { free(transitions); free(timed); transitions = NULL; timed = NULL; }
In many examples the stack is being used to store the transitions. For example SimpleTransitions.ino:
Transition transitions[] = { Transition(&s[0], &s[1], light_switch_flipped, on_to_off), Transition(&s[1], &s[0], light_switch_flipped, off_to_on) };
There should be a well defined and documented way how to handle memory management with SimpleFSM.
Hey, thanks for pointing this out. You are right, of course. Will merge it.
(And thanks for all the other reviews and pull requests. Will now work through them one by one 😄 )
The destructor of SimpleFSM:
In many examples the stack is being used to store the transitions. For example SimpleTransitions.ino:
There should be a well defined and documented way how to handle memory management with SimpleFSM.