# Release()

> Releases the loaded object so that Unity can unload it.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Loading](/engine/6000.7/script-reference/unity/loading.md)
* **Assembly:** UnityEngine.ContentLoadModule

```csharp
public void Release()
```

### Remarks

Unity reference counts the loaded object, so loading the same asset through several [Loadable\<T>](/engine/6000.7/script-reference/unity/loading/loadable1.md) instances works correctly, and the object unloads only when the last reference is released.

Each [Loadable\<T>](/engine/6000.7/script-reference/unity/loading/loadable1.md) instance holds at most one reference. Repeated [Loadable\<T>.Load](/engine/6000.7/script-reference/unity/loading/loadable1/load.md) or [Loadable\<T>.LoadAsync](/engine/6000.7/script-reference/unity/loading/loadable1/loadasync.md) calls on the same instance return the same load operation without taking another reference, so a single Release frees it and any further Release does nothing. Release every instance that you loaded, otherwise the object stays loaded after your code stops using it.

Release is not recursive. If this Loadable references a [ScriptableObject](/engine/6000.7/script-reference/unityengine/scriptableobject.md) that has loaded [Loadable\<T>](/engine/6000.7/script-reference/unity/loading/loadable1.md) fields of its own, releasing this Loadable does not release those inner ones. Release each [Loadable\<T>](/engine/6000.7/script-reference/unity/loading/loadable1.md) that was loaded.

The `OnDestroy` message of a [MonoBehaviour](/engine/6000.7/script-reference/unityengine/monobehaviour.md) is a good place to release its [Loadable\<T>](/engine/6000.7/script-reference/unity/loading/loadable1.md) fields, so that unloading a scene or destroying a prefab instance does not leave content loaded that nothing can reach.

Release has no effect on content that was loaded from the [AssetDatabase](/engine/6000.7/script-reference/unityeditor/assetdatabase.md) in Play mode, because that content is not reference counted. Refer to the [Loadable\<T>](/engine/6000.7/script-reference/unity/loading/loadable1.md) remarks for details.
