From 196e34266a71eefeb341141fb0d53641dc8bf5a0 Mon Sep 17 00:00:00 2001 From: Andrey Klimov Date: Fri, 8 Oct 2021 00:00:27 +0300 Subject: [PATCH] violation while stop chans --- lighthub/main.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lighthub/main.cpp b/lighthub/main.cpp index 5ca96b1..d5da484 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -182,21 +182,24 @@ if (configLocked) debugSerial<child; -while (items && item) - { - if (item->type == aJson_Array && aJson.getArraySize(item)>0) + while (item) { if (item->type == aJson_Array && aJson.getArraySize(item)>0) { - Item it(item->name); - if (it.isValid()) it.Stop(); - yield(); + if (item->type == aJson_Array && aJson.getArraySize(item)>0) + { + Item it(item->name); + if (it.isValid()) it.Stop(); + yield(); + } + item = item->next; } - item = item->next; - } -} + } +} pollingItem = NULL; debugSerial<