Skip to content

Commit df3a7cf

Browse files
committed
Regenerating weak reference now defers the call to the regenerator until the first use.
1 parent dc28c9e commit df3a7cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

WebAssembly/RegeneratingWeakReference.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace WebAssembly;
55
readonly struct RegeneratingWeakReference<T>(Func<T> regenerator)
66
where T : class
77
{
8-
private readonly WeakReference<T> reference = new(regenerator(), false);
8+
private readonly WeakReference<T> reference = new(null!);
99

1010
public T Reference
1111
{

0 commit comments

Comments
 (0)