From 39b8b0b9bcf5805ada1a44e5dc72f05f9c6e4fcc Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 25 七月 2023 13:12:30 +0800
Subject: [PATCH] 2.0备份

---
 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