From a59663c4981c498f007307f7115f6850ab73e239 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 21 七月 2023 21:06:51 +0800
Subject: [PATCH] 群控界面修复  1.9版本bug修复

---
 HDL_ON/Entity/Function/Function.cs |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 8f4f3c3..0baf1eb 100644
--- a/HDL_ON/Entity/Function/Function.cs
+++ b/HDL_ON/Entity/Function/Function.cs
@@ -803,25 +803,27 @@
             var list = new List<FunctionAttributes>();
             if (spk == SPK.GroupControl)
             {
-                var gc = FunctionList.List.groupControls.Find((obj) => obj.sid == sid);
-                if (gc != null)
+                lock (list)
                 {
-                    foreach (var temp in gc.sids)
+                    var gc = FunctionList.List.groupControls.Find((obj) => obj.sid == sid);
+                    if (gc != null)
                     {
-                        var light = FunctionList.List.GetLightList().Find((obj) => obj.sid == temp.sid);
-                        if (light != null)
+                        foreach (var temp in gc.sids)
                         {
-                            foreach (var attr in light.attributes)
+                            var light = FunctionList.List.GetLightList().Find((obj) => obj.sid == temp.sid);
+                            if (light != null)
                             {
-                                if (list.Find((obj) => obj.key == attr.key) == null)
+                                foreach (var attr in light.attributes)
                                 {
-                                    list.Add(attr);
+                                    if (list.Find((obj) => obj.key == attr.key) == null)
+                                    {
+                                        list.Add(attr);
+                                    }
                                 }
                             }
                         }
                     }
                 }
-
             }
             else
             {

--
Gitblit v1.8.0