---
title: Dispose()
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/animationstreammask/dispose
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/animationstreammask/dispose.md
last_updated: 2026-11-30
generated_at: 2026-11-30T21:33:23.874Z
locale: en-us
---

# Dispose()

> Releases the mask.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Animations](/engine/7000.0/script-reference/unity/animations.md)
* **Assembly:** [UnityEngine.AnimationCoreModule](/engine/7000.0/script-reference/modules/unityengine-animationcoremodule.md)

```csharp
public void Dispose()
```

### Remarks

For a mask created with [AnimationStreamMask.Create](/engine/7000.0/script-reference/unity/animations/animationstreammask/create.md), this method frees the buffer. Copies of the mask share the buffer, so call this method on only one copy. For any other mask, this method resets only the copy that you call it on to a default mask. It doesn't touch the memory that the mask points to. If you call it on a default mask, it has no effect. A mask that owned its buffer is also a default mask after you dispose it. If safety checks are enabled and you call this method on it again, it throws an `ObjectDisposedException`.
