Răsfoiți Sursa

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 ani în urmă
părinte
comite
01c6252579
1 a modificat fișierele cu 9 adăugiri și 0 ștergeri
  1. 9 0
      src/TaskScheduler.h

+ 9 - 0
src/TaskScheduler.h

@@ -107,6 +107,11 @@
 // v2.3.0:
 // v2.3.0:
 //    2017-02-24 - new timeUntilNextIteration() method within Scheduler class - inquire when a particlar task is 
 //    2017-02-24 - new timeUntilNextIteration() method within Scheduler class - inquire when a particlar task is 
 //                 scheduled to run next time
 //                 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>
 #include <Arduino.h>
 
 
@@ -358,6 +363,10 @@ Task::Task( unsigned long aInterval, long aIterations, void (*aCallback)(), Sche
 	if (aEnable) enable();
 	if (aEnable) enable();
 }
 }
 
 
+/** Destructor.
+ *  Makes sure the task disabled and deleted out of the chain
+ *  prior to being deleted.
+ */
 Task::~Task() {
 Task::~Task() {
     disable();
     disable();
     if (iScheduler)
     if (iScheduler)