fix: use-after-free issue in NativeMemoryManager (#1006)

Closes: #1001
This commit is contained in:
bd_ 2024-08-13 20:32:52 -07:00 committed by GitHub
parent 467b0d4431
commit 1b3b9194c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -97,7 +97,10 @@ namespace nadena.dev.modular_avatar.core.armature_lock
};
arrays.Add(InUseMask);
_allocationMap.OnSegmentDispose += seg => { SetInUseMask(seg.Offset, seg.Length, false); };
_allocationMap.OnSegmentDispose += seg =>
{
if (!_isDisposed) SetInUseMask(seg.Offset, seg.Length, false);
};
}
public NativeArrayRef<T> CreateArray<T>() where T : unmanaged