# Dispose

> Disposes a NativeArray<T>.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections](/engine/6000.0/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.CoreModule

## Dispose()

Disposes a [NativeArray\<T>](/engine/6000.0/script-reference/unity/collections/nativearray1.md).

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

### Remarks

This methods disposes the memory owned by a [NativeArray\<T>](/engine/6000.0/script-reference/unity/collections/nativearray1.md). The behavior of this methods depends on the [Allocator](/engine/6000.0/script-reference/unity/collections/allocator.md) used when the NativeArray was created.

## Dispose(JobHandle)

Creates and schedules a job that releases all resources (memory and safety handles) of a [NativeArray\<T>](/engine/6000.0/script-reference/unity/collections/nativearray1.md).

```csharp
public JobHandle Dispose(JobHandle inputDeps)
```

### Parameters

**** (\[JobHandle]\(/engine/6000.0/script-reference/unity/jobs/jobhandle)): The dependency of the new job.

### Returns

| Type                                                                 | Description                                                                                                                                                                                                                                                                    |
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [JobHandle](/engine/6000.0/script-reference/unity/jobs/jobhandle.md) | The [JobHandle](/engine/6000.0/script-reference/unity/jobs/jobhandle.md)] of the new job. The job depends upon `inputDeps` and releases all resources (memory and safety handles) of the [NativeArray\<T>](/engine/6000.0/script-reference/unity/collections/nativearray1.md). |
