Skip to content

Commit 167d937

Browse files
authored
dispose (#276)
1 parent 8717e88 commit 167d937

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

BitFaster.Caching/Lfu/ConcurrentLfu.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ public V GetOrAdd(K key, Func<K, V> valueFactory)
210210
AfterWrite(node);
211211
return node.Value;
212212
}
213+
214+
Disposer<V>.Dispose(node.Value);
213215
}
214216
}
215217

@@ -229,6 +231,8 @@ public async ValueTask<V> GetOrAddAsync(K key, Func<K, Task<V>> valueFactory)
229231
AfterWrite(node);
230232
return node.Value;
231233
}
234+
235+
Disposer<V>.Dispose(node.Value);
232236
}
233237
}
234238

0 commit comments

Comments
 (0)