violation while stop chans

This commit is contained in:
2021-10-08 00:00:27 +03:00
parent 0da8708327
commit 196e34266a

View File

@@ -182,21 +182,24 @@ if (configLocked)
debugSerial<<F("Stopping channels ...")<<endl; debugSerial<<F("Stopping channels ...")<<endl;
timerHandlerBusy++; timerHandlerBusy++;
//Stoping the channels //Stoping the channels
if (items)
{
aJsonObject * item = items->child; aJsonObject * item = items->child;
while (items && item) while (item)
{
if (item->type == aJson_Array && aJson.getArraySize(item)>0)
{ {
if (item->type == aJson_Array && aJson.getArraySize(item)>0) if (item->type == aJson_Array && aJson.getArraySize(item)>0)
{ {
Item it(item->name); if (item->type == aJson_Array && aJson.getArraySize(item)>0)
if (it.isValid()) it.Stop(); {
yield(); Item it(item->name);
if (it.isValid()) it.Stop();
yield();
}
item = item->next;
} }
item = item->next; }
} }
}
pollingItem = NULL; pollingItem = NULL;
debugSerial<<F("Stopped")<<endl; debugSerial<<F("Stopped")<<endl;