Documentation

Unity Engine

Download Unity

Unity Engine

Dispose()

Releases the memory of the sampler.
Read time 1 minuteLast updated 4 hours ago

Definition

public void Dispose()

Remarks

Copies of the sampler share the same memory. Call this method on only one copy, and don't use the other copies or the masks that you created from the sampler afterward. A sampler from WeightMaskSampler.Clone has its own memory, so this method doesn't affect it. This method has no effect on a default sampler.
If safety checks are enabled, a second call to this method throws an
ObjectDisposedException
on any copy. For a sampler that uses Allocator.Temp, the safety system doesn't detect that you use another copy after this call, as for other containers that use Allocator.Temp. The memory stays valid until the end of the scope of the temporary allocations.