This commit is contained in:
Lordfox
2025-10-04 12:10:40 +02:00
parent 8199daff25
commit 329241bcde
@@ -547,9 +547,13 @@ namespace OpenSim.Region.CoreModules.Asset
{
weakAssetReferences.AddOrUpdate(
key,
static _ => new WeakReference<AssetBase>(asset),
static (_, existing) =>
_ => new WeakReference<AssetBase>(asset),
(_, existing) =>
{
// defensive: handle rare case where existing could be null
if (existing is null)
return new WeakReference<AssetBase>(asset);
existing.SetTarget(asset);
return existing;
});