We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2e2d22 commit f9c60a2Copy full SHA for f9c60a2
cores/esp8266/Schedule.cpp
@@ -65,12 +65,12 @@ bool schedule_function(std::function<void(void)> fn)
65
66
void run_scheduled_functions()
67
{
68
- while (sFirst) {
69
- scheduled_fn_t* item = sFirst;
70
- sFirst = item->mNext;
71
- if (sFirst == NULL) {
72
- sLast = NULL;
73
- }
+ scheduled_fn_t* rFirst = sFirst;
+ sFirst = NULL;
+ sLast = NULL;
+ while (rFirst) {
+ scheduled_fn_t* item = rFirst;
+ rFirst = item->mNext;
74
item->mFunc();
75
item->mFunc = std::function<void(void)>();
76
recycle_fn(item);
0 commit comments