From 79115bd199ce0112926e49ad2ba4df1e2666adcf Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Tue, 19 Jul 2022 10:53:06 +0200 Subject: [PATCH] Don't add duplicate frames. --- src/Avalonia.Base/PropertyStore/ValueStore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Base/PropertyStore/ValueStore.cs b/src/Avalonia.Base/PropertyStore/ValueStore.cs index 093235955e..a90bb4eb73 100644 --- a/src/Avalonia.Base/PropertyStore/ValueStore.cs +++ b/src/Avalonia.Base/PropertyStore/ValueStore.cs @@ -141,7 +141,6 @@ namespace Avalonia.PropertyStore { var frame = GetOrCreateImmediateValueFrame(property, priority); result = frame.AddValue(property, value); - InsertFrame(frame); } if (TryGetEffectiveValue(property, out var existing)) @@ -528,6 +527,7 @@ namespace Avalonia.PropertyStore private void InsertFrame(IValueFrame frame) { + Debug.Assert(!_frames.Contains(frame)); var index = _frames.BinarySearch(frame, FrameInsertionComparer.Instance); if (index < 0) index = ~index;