[NUI] Clean NUI codes from Adaptor.cs to Window.cs (#652)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / XamlBinding / SynchronizedList.cs
index d0829e4..a0761b4 100755 (executable)
@@ -75,14 +75,15 @@ namespace Tizen.NUI.Binding
 
         public IEnumerator<T> GetEnumerator()
         {
-            ReadOnlyCollection<T> snap = _snapshot;
-            if (snap == null)
+            lock (_list)
             {
-                lock (_list)
+                ReadOnlyCollection<T> snap = _snapshot;
+                if (snap == null)
+                {
                     _snapshot = snap = new ReadOnlyCollection<T>(_list.ToList());
+                }
+                return snap?.GetEnumerator();
             }
-
-            return snap?.GetEnumerator();
         }
 
         public int IndexOf(T item)
@@ -112,7 +113,6 @@ namespace Tizen.NUI.Binding
 
                     return _list[index];
                 }
-
             }
 
             set