From 83bf4cadfc3ae9ddf41608fab226b2396f52803d Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Mon, 25 Aug 2025 13:37:00 -0700 Subject: [PATCH] Make sure to null out the factory after first allocation --- sources/ClangSharp/ValueLazy`1.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/ClangSharp/ValueLazy`1.cs b/sources/ClangSharp/ValueLazy`1.cs index 7d5edf36..645aacbb 100644 --- a/sources/ClangSharp/ValueLazy`1.cs +++ b/sources/ClangSharp/ValueLazy`1.cs @@ -32,6 +32,7 @@ public T Value if (_factory is Func factory) { _value = factory(); + _factory = null; } return _value; }