SimpleScheduler.cpp
// Destructor -- remove all tasks to free up heap space.
//    probably unnecessary as Scheduler is expected to be created in the global sketch space
//    so it is accessible in both setup() and loop(), but it's good programming practice, and
//    I do intend to experiment with non-ArduinoIDE development at some point, and it will be
//    good to minimize the things which I'll need to change in my libraries.  Since we do
//    use dynamically allocated memory, let's make sure we play nice and return it if/when
//    this goes out of scope.
- remove all tasks to free up heap space.
probably unnecessary as Scheduler is expected to be created in the global sketch space
so it is accessible in both setup() and loop(), but it's good programming practice, and
I do intend to experiment with non-ArduinoIDE development at some point, and it will be
good to minimize the things which I'll need to change in my libraries.  Since we do
use dynamically allocated memory, let's make sure we play nice and return it if/when
this goes out of scope.
- remove all tasks to free up heap space . probably unnecessary as Scheduler is expected to be created in the global sketch space so it is accessible in both setup () and loop () but it ' s good programming practice and I do intend to experiment with non - ArduinoIDE development at some point and it will be good to minimize the things which I ' ll need to change in my libraries . Since we do use dynamically allocated memory let ' s make sure we play nice and return it if / when this goes out of scope .
SimpleScheduler::~SimpleScheduler(void) {
  SimpleTask current = taskList ;
  while (current) {
    SimpleTask next = current ;
    removeTask(current) ;
    current = next ;
  }
  taskList = NULL ;
}
SimpleScheduler :: ~ SimpleScheduler ( void ) { SimpleTask current = taskList ; while ( current ) { SimpleTask next = current ; removeTask ( current ) ; current = next ; } taskList = NULL ; }
Destructor -- remove all tasks to free up heap space.
Destructor -- remove all tasks to free up heap space .