[Connection] Use lock for event (#5971)
authorchleun-moon <32117100+chleun-moon@users.noreply.github.com>
Thu, 22 Feb 2024 05:34:25 +0000 (14:34 +0900)
committerGitHub <noreply@github.com>
Thu, 22 Feb 2024 05:34:25 +0000 (14:34 +0900)
src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs

index 637f3c0..162ac64 100644 (file)
@@ -427,21 +427,33 @@ namespace Tizen.Network.Connection
 
         private void UnregisterEvents()
         {
-            if (_ConnectionTypeChanged != null)
+            lock (_ConnectionTypeChangedLock)
             {
-                ConnectionTypeChangedStop();
+                if (_ConnectionTypeChanged != null)
+                {
+                    ConnectionTypeChangedStop();
+                }
             }
-            if (_IPAddressChanged != null)
+            lock (_IPAddressChangedLock)
             {
-                IPAddressChangedStop();
+                if (_IPAddressChanged != null)
+                {
+                    IPAddressChangedStop();
+                }
             }
-            if (_EthernetCableStateChanged != null)
+            lock(_EthernetCableStateChangedLock)
             {
-                EthernetCableStateChangedStop();
+                if (_EthernetCableStateChanged != null)
+                {
+                    EthernetCableStateChangedStop();
+                }
             }
-            if (_ProxyAddressChanged != null)
+            lock (_ProxyAddressChangedLock)
             {
-                ProxyAddressChangedStop();
+                if (_ProxyAddressChanged != null)
+                {
+                    ProxyAddressChangedStop();
+                }
             }
         }