Просмотр исходного кода

v2.4.0 - added destructor to the Task clas

- added destructor to the Task class to ensure tasks are disables and
taken off the execution chain upon destruction. (Contributed by Edwin
van Leeuwen [BlackEdder - https://github.com/BlackEdder)
Anatoli Arkhipenko 8 лет назад
Родитель
Сommit
01c6252579
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      src/TaskScheduler.h

+ 9 - 0
src/TaskScheduler.h

@@ -107,6 +107,11 @@
 // v2.3.0:
 //    2017-02-24 - new timeUntilNextIteration() method within Scheduler class - inquire when a particlar task is 
 //                 scheduled to run next time
+//
+// v2.4.0:
+//    2017-04-27 - added destructor to the Task class to ensure tasks are disables and taken off the execution chain
+//                 upon destruction. (Contributed by Edwin van Leeuwen [BlackEdder - https://github.com/BlackEdder)
+
 
 #include <Arduino.h>
 
@@ -358,6 +363,10 @@ Task::Task( unsigned long aInterval, long aIterations, void (*aCallback)(), Sche
 	if (aEnable) enable();
 }
 
+/** Destructor.
+ *  Makes sure the task disabled and deleted out of the chain
+ *  prior to being deleted.
+ */
 Task::~Task() {
     disable();
     if (iScheduler)