# Dispose()

> Disposes of the native memory allocated by the collection.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.Physics2DModule

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

### Remarks

If the [ColliderArray2D.Length](/engine/6000.7/script-reference/unityengine/colliderarray2d/length.md) is zero, calling Dispose is optional as no memory would have been allocated in that case.
