apply the increment to all ctors
authorStephane Delcroix <stephane@delcroix.org>
Fri, 30 Nov 2018 08:20:19 +0000 (09:20 +0100)
committerStephane Delcroix <stephane@delcroix.org>
Fri, 30 Nov 2018 08:20:19 +0000 (09:20 +0100)
Xamarin.Forms.Core/DataTemplate.cs

index 01715ca..567c32b 100644 (file)
@@ -13,8 +13,8 @@ namespace Xamarin.Forms
                string _idString;
                public DataTemplate()
                {
-                       _idString = GetType().FullName + idCounter++;
-                       _id = idCounter;
+                       _id = Interlocked.Increment(ref idCounter);
+                       _idString = GetType().FullName + _id;
                }
 
                public DataTemplate(Type type) : base(type)